예제 #1
0
        public void WillReturnNullIfInvalidName()
        {
            Assert.IsNull(ResisterBand.Parse("asdfasdfasdf"));

            //It can be argued that the two instances below should return none rather than null.
            Assert.IsNull(ResisterBand.Parse(""));
            Assert.IsNull(ResisterBand.Parse(null));
        }
예제 #2
0
        public void WillReturnOrange()
        {
            var names = new string[] { "Orange", "OG", "W" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Orange);
            }
        }
예제 #3
0
        public void WillReturnRed()
        {
            var names = new string[] { "Red", "RD", "G" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Red);
            }
        }
예제 #4
0
        public void WillReturnBrown()
        {
            var names = new string[] { "Brown", "BN", "F" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Brown);
            }
        }
예제 #5
0
        public void WillReturnBlack()
        {
            var names = new string[] { "Black", "BK" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Black);
            }
        }
예제 #6
0
        public void WillReturnGold()
        {
            var names = new string[] { "Gold", "GD", "J" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Gold);
            }
        }
예제 #7
0
        public void WillReturnSilver()
        {
            var names = new string[] { "Silver", "SR", "K" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Silver);
            }
        }
예제 #8
0
        public void WillReturnPink()
        {
            var names = new string[] { "Pink", "PK" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Pink);
            }
        }
예제 #9
0
        public void WillReturnNone()
        {
            var names = new string[] { "None", "M" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.None);
            }
        }
예제 #10
0
        public void WillReturnWhite()
        {
            var names = new string[] { "White", "WH" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.White);
            }
        }
예제 #11
0
        public void WillReturnGrey()
        {
            var names = new string[] { "Gray", "Grey", "GY", "L", "A" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Grey);
            }
        }
예제 #12
0
        public void WillReturnViolet()
        {
            var names = new string[] { "Violet", "VT", "B" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Violet);
            }
        }
예제 #13
0
        public void WillReturnGreen()
        {
            var names = new string[] { "Green", "GN", "D" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Green);
            }
        }
예제 #14
0
        public void WillReturnYellow()
        {
            var names = new string[] { "Yellow", "YE", "P" };

            foreach (var name in names)
            {
                Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Yellow);
            }
        }