Пример #1
0
        public void ThrowExceptionWhenWrongStringPassedToGender()
        {
            string wrongValue = "erhgrw";

            Assert.Throws <Exception>(() => EnumMapper.MapValueToEnum <Gender, string>(wrongValue));
        }
Пример #2
0
        public void ThrowExceptionWhenWrongStringPassedToWeekday()
        {
            string wrongValue = "ygukmj";

            Assert.Throws <Exception>(() => EnumMapper.MapValueToEnum <Weekday, string>(wrongValue));
        }
Пример #3
0
        public void ReturnCorrectWeekdayWhenIntIsPassed()
        {
            Gender result = EnumMapper.MapValueToEnum <Gender, int>(4);

            Assert.AreEqual("Friday", result);
        }
Пример #4
0
        public void ReturnCorrectWeekdayWhenStringIsPassed()
        {
            Gender result = EnumMapper.MapValueToEnum <Gender, string>("Monay");

            Assert.AreEqual("Monday", result);
        }
Пример #5
0
        public void ReturnCorrectGenderWhenStringIsPassed()
        {
            Gender result = EnumMapper.MapValueToEnum <Gender, string>("Female");

            Assert.AreEqual("Female", result);
        }
Пример #6
0
        public void ReturnCorrectGenderWhenIntIsPassed()
        {
            Gender result = EnumMapper.MapValueToEnum <Gender, int>(1);

            Assert.AreEqual(Gender.Male, result);
        }
Пример #7
0
        public void ReturnCorrectWeekdayWhenStringIsPassed()
        {
            Weekday result = EnumMapper.MapValueToEnum <Weekday, string>("Monday");

            Assert.AreEqual(Weekday.Monday, result);
        }
Пример #8
0
        public void ReturnCorrectWeekdayWhenIntIsPassed()
        {
            Weekday result = EnumMapper.MapValueToEnum <Weekday, int>(4);

            Assert.AreEqual(Weekday.Friday, result);
        }
Пример #9
0
        public void ReturnCorrectGenderWhenStringIsPassed()
        {
            Gender result = EnumMapper.MapValueToEnum <Gender, string>("Female");

            Assert.IsTrue(Gender.Female == result);
        }