示例#1
0
 public void Static_PrepareGroups_InvalidElement_ShouldThrowArgumentException(string e)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         AuthTools.PrepareGroups(new string[] { e });
     });
 }
示例#2
0
 public void Static_PrepareGroups_NullGroups()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         AuthTools.PrepareGroups(null);
     });
 }
示例#3
0
        public void Static_PrepareGroups()
        {
            Assert.AreEqual(0, AuthTools.PrepareGroups(new string[0]).Length, "Wrong result length");

            string[] input  = new string[] { "Group", "G.Group" };
            string[] output = AuthTools.PrepareGroups(input);

            Assert.AreEqual(input.Length, output.Length, "Wrong result length");
            for (int i = 0; i < input.Length; i++)
            {
                Assert.AreEqual("G." + input[i], output[i], "Wrong value");
            }
        }
示例#4
0
        public void Static_PrepareGroups()
        {
            var groups = AuthTools.PrepareGroups(new string[0]).ToList();

            Assert.AreEqual(0, groups.Count, "Wrong result length");

            string[] input  = { "Group", "G.Group" };
            var      output = AuthTools.PrepareGroups(input).ToList();

            Assert.AreEqual(input.Length, output.Count, "Wrong result length");
            for (var i = 0; i < input.Length; i++)
            {
                Assert.AreEqual("G." + input[i], output[i], "Wrong value");
            }
        }
示例#5
0
 public void Static_PrepareGroups_InvalidElement(string e)
 {
     AuthTools.PrepareGroups(new[] { e });
 }
示例#6
0
 public void Static_PrepareGroups_NullGroups()
 {
     AuthTools.PrepareGroups(null);
 }