public void DecodeArray_RightFrame_DecodedFrame() { string frame = "RED=120;BLUE=100"; List <DataWrapper> dws = FrameParser.DecodeArray(frame); List <DataWrapper> excepted = new List <DataWrapper>() { new DataWrapper("RED", 120), new DataWrapper("BLUE", 100) }; bool actual = true; for (int i = 0; i < dws.Count; i++) { if (dws[i].Name != excepted[i].Name || dws[i].Value.ToString() != excepted[i].Value.ToString()) { actual = false; } } Assert.IsTrue(actual); }
public void DecodeArray_FrameContainsTooMuchSepator_WrongFormatException() { FrameParser.DecodeArray("RED=120;BLUE=100;"); }
public void DecodeArray_EmptyFrame_ArgumentNullException() { FrameParser.DecodeArray(string.Empty); }
public void DecodeArray_NullFrame_ArgumentNullException() { FrameParser.DecodeArray(null); }