-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScopeTest.cs
More file actions
40 lines (33 loc) · 998 Bytes
/
ScopeTest.cs
File metadata and controls
40 lines (33 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
// ReSharper disable CheckNamespace
namespace LiveSDKHelper.Test.ScopeEnum
{
[TestClass]
public class ScopeTest
{
[TestMethod]
public void MustAllHaveScopeNameAttribute()
{
var scopeValues = Enum.GetValues(typeof(Scope));
var scopes = scopeValues.Cast<Scope>().ToList();
var scopesWithName = new List<Scope>(scopes.Where(scope => scope.ToStringScope() != string.Empty));
Assert.AreEqual(scopes.Count, scopesWithName.Count);
}
[TestMethod]
public void MustEachHaveUniqueScopeName()
{
var scopeValues = Enum.GetValues(typeof(Scope));
var scopes = scopeValues.Cast<Scope>().ToList();
var scopeNames = new List<string>();
foreach (var scope in scopes)
{
if (scopeNames.Contains(scope.ToStringScope())) { continue; }
scopeNames.Add(scope.ToStringScope());
}
Assert.AreEqual(scopes.Count, scopeNames.Count);
}
}
}