-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScopeTest.cs
More file actions
28 lines (26 loc) · 870 Bytes
/
ScopeTest.cs
File metadata and controls
28 lines (26 loc) · 870 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
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Reflection;
// ReSharper disable CheckNamespace
namespace LiveSDKHelper.Test.ScopeEnum
{
[TestClass]
public class ScopeTest
{
[TestMethod]
public void MustEachHaveUniqueScopeName()
{
FieldInfo[] fieldinfoArray = typeof(Scope).GetFields(System.Reflection.BindingFlags.Static);
List<string> fieldInfoNames = new List<string>();
foreach (var fi in fieldinfoArray)
{
fieldInfoNames.Add(fi.GetRawConstantValue().ToString());
}
int scopesCount = fieldinfoArray.Length;
int scopesNameCount = fieldInfoNames.Distinct().Count();
Assert.AreEqual(scopesCount, scopesNameCount);
}
}
}