Exemple #1
0
        public void TestGetIndividualValues()
        {
            // Arrange
            SecondFlagsEnum
                testOne   = (SecondFlagsEnum)6,
                testTwo   = (SecondFlagsEnum)31,
                testThree = (SecondFlagsEnum)2,
                testFour  = (SecondFlagsEnum)0;

            SecondFlagsEnum[]
            expectedOne = new SecondFlagsEnum[] {
                SecondFlagsEnum.Two,
                SecondFlagsEnum.Four
            },
            expectedTwo = new SecondFlagsEnum[] {
                SecondFlagsEnum.One,
                SecondFlagsEnum.Two,
                SecondFlagsEnum.Four,
                SecondFlagsEnum.Eight,
                SecondFlagsEnum.Sixteen
            },
            expectedThree = new SecondFlagsEnum[] {
                SecondFlagsEnum.Two
            },
            expectedFour = new SecondFlagsEnum[0];

            // Act
            var resultOne   = testOne.GetIndividualValues();
            var resultTwo   = testTwo.GetIndividualValues();
            var resultThree = testThree.GetIndividualValues();
            var resultFour  = testFour.GetIndividualValues();

            // Assert
            Assert.AreEqual(expectedOne, resultOne, "Result 1");
            Assert.AreEqual(expectedTwo, resultTwo, "Result 2");
            Assert.AreEqual(expectedThree, resultThree, "Result 3");
            Assert.AreEqual(expectedFour, resultFour, "Result 4");
        }
    public void TestGetIndividualValues()
    {
      // Arrange
      SecondFlagsEnum
        testOne = (SecondFlagsEnum) 6,
        testTwo = (SecondFlagsEnum) 31,
        testThree = (SecondFlagsEnum) 2,
        testFour = (SecondFlagsEnum) 0;
      SecondFlagsEnum[]
        expectedOne = new SecondFlagsEnum[] { 
          SecondFlagsEnum.Two, 
          SecondFlagsEnum.Four
        },
        expectedTwo = new SecondFlagsEnum[] { 
          SecondFlagsEnum.One,
          SecondFlagsEnum.Two,
          SecondFlagsEnum.Four,
          SecondFlagsEnum.Eight,
          SecondFlagsEnum.Sixteen
        },
        expectedThree = new SecondFlagsEnum[] {
          SecondFlagsEnum.Two
        },
        expectedFour = new SecondFlagsEnum[0];

      // Act
      var resultOne = testOne.GetIndividualValues();
      var resultTwo = testTwo.GetIndividualValues();
      var resultThree = testThree.GetIndividualValues();
      var resultFour = testFour.GetIndividualValues();

      // Assert
      Assert.AreEqual(expectedOne, resultOne, "Result 1");
      Assert.AreEqual(expectedTwo, resultTwo, "Result 2");
      Assert.AreEqual(expectedThree, resultThree, "Result 3");
      Assert.AreEqual(expectedFour, resultFour, "Result 4");
    }