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)); }
public void WillReturnOrange() { var names = new string[] { "Orange", "OG", "W" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Orange); } }
public void WillReturnRed() { var names = new string[] { "Red", "RD", "G" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Red); } }
public void WillReturnBrown() { var names = new string[] { "Brown", "BN", "F" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Brown); } }
public void WillReturnBlack() { var names = new string[] { "Black", "BK" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Black); } }
public void WillReturnGold() { var names = new string[] { "Gold", "GD", "J" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Gold); } }
public void WillReturnSilver() { var names = new string[] { "Silver", "SR", "K" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Silver); } }
public void WillReturnPink() { var names = new string[] { "Pink", "PK" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Pink); } }
public void WillReturnNone() { var names = new string[] { "None", "M" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.None); } }
public void WillReturnWhite() { var names = new string[] { "White", "WH" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.White); } }
public void WillReturnGrey() { var names = new string[] { "Gray", "Grey", "GY", "L", "A" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Grey); } }
public void WillReturnViolet() { var names = new string[] { "Violet", "VT", "B" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Violet); } }
public void WillReturnGreen() { var names = new string[] { "Green", "GN", "D" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Green); } }
public void WillReturnYellow() { var names = new string[] { "Yellow", "YE", "P" }; foreach (var name in names) { Assert.AreEqual(ResisterBand.Parse(name), ResisterBand.Yellow); } }