public void Test_NotSet_GetColumnInfo_ReturnNull() { var usageRecord = new UsageRecord(); var actual = usageRecord.GetColumnInfo(); Assert.Null(actual); }
public void Test_SetAndGetColumnInfo() { var columns = new List <Column> { new Column() { System = "A", SerialNumber = "001", Value = 1f, Unit = "Mpa" }, }; var usageRecord = new UsageRecord(); usageRecord.SetColumnInfo(columns); var actual = usageRecord.GetColumnInfo(); //Assert.Equal("[{\"System\":\"A\",\"SerialNumber\":\"001\",\"Value\":1.0,\"Unit\":\"Mpa\"}]", usageRecord.Column); Assert.Equal(columns[0].System, actual[0].System); Assert.Equal(columns[0].SerialNumber, actual[0].SerialNumber); Assert.Equal(columns[0].Value, actual[0].Value); Assert.Equal(columns[0].Unit, actual[0].Unit); }