コード例 #1
0
        public void FridayTo5()
        {
            string weekday    = "FR";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(5, weekdayInt);
        }
コード例 #2
0
        public void SaturdayTo6()
        {
            string weekday    = "SA";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(6, weekdayInt);
        }
コード例 #3
0
        public void WednesdayTo3()
        {
            string weekday    = "WE";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(3, weekdayInt);
        }
コード例 #4
0
        public void ThursdayTo4()
        {
            string weekday    = "TH";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(4, weekdayInt);
        }
コード例 #5
0
        public void Test1toMO()
        {
            int    weekdayInt = 1;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("MO", weekday);
        }
コード例 #6
0
        public void TuesdayTo2()
        {
            string weekday    = "TU";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(2, weekdayInt);
        }
コード例 #7
0
        public void InvalidNegative1()
        {
            int    weekdayInt = -1;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual(string.Empty, weekday);
        }
コード例 #8
0
        public void SundayTo0()
        {
            string weekday    = "SU";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(0, weekdayInt);
        }
コード例 #9
0
        public void Test5toFR()
        {
            int    weekdayInt = 5;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("FR", weekday);
        }
コード例 #10
0
        public void Test6toSA()
        {
            int    weekdayInt = 6;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("SA", weekday);
        }
コード例 #11
0
        public void Test4toTH()
        {
            int    weekdayInt = 4;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("TH", weekday);
        }
コード例 #12
0
        public void Test3toWE()
        {
            int    weekdayInt = 3;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("WE", weekday);
        }
コード例 #13
0
        public void Test2toTU()
        {
            int    weekdayInt = 2;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("TU", weekday);
        }
コード例 #14
0
        public void InvalidNull()
        {
            string weekday    = null;
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(-1, weekdayInt);
        }
コード例 #15
0
        public void Invalid27()
        {
            int    weekdayInt = 27;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual(string.Empty, weekday);
        }
コード例 #16
0
        public void InvalidEmpty()
        {
            string weekday    = string.Empty;
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(-1, weekdayInt);
        }
コード例 #17
0
        public void MondayTo1()
        {
            string weekday    = "MO";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(1, weekdayInt);
        }
コード例 #18
0
        public void InvalidWrong()
        {
            string weekday    = "bad";
            int    weekdayInt = WeekdayConverter.Convert(weekday);

            Assert.AreEqual(-1, weekdayInt);
        }
コード例 #19
0
        public void Test0toSU()
        {
            int    weekdayInt = 0;
            string weekday    = WeekdayConverter.Convert(weekdayInt);

            Assert.AreEqual("SU", weekday);
        }