예제 #1
0
        public void ItShouldThrowWhenParseNoFlagsFromFlagString()
        {
            var invalidString = "red, black";

            var exception = Record.Exception(() => NoFlagsEnum.Parse(invalidString));

            Assert.NotNull(exception);
            Assert.IsType <ArgumentException>(exception);
        }
예제 #2
0
        public void ItShouldThrowWhenNoFlagsFromFlagValue()
        {
            var invalidValue = 3;

            var exception = Record.Exception(() => NoFlagsEnum.FromValue(invalidValue));

            Assert.NotNull(exception);
            Assert.IsType <ArgumentOutOfRangeException>(exception);
        }