public void WhenValueIsValidString_ThenProduceTinyType() { var validString = "Valid String"; var tc = new TinyTypeTypeConverter <ServerTaskId>(); var result = tc.ConvertFrom(validString) as ServerTaskId; var expectedResult = CaseInsensitiveTinyType.Create <ServerTaskId>(validString); Assert.AreEqual(expectedResult, result); }
public void WhenValueIsNonString_ThenThrowException() { var tc = new TinyTypeTypeConverter <ServerTaskId>(); Assert.Throws <Exception>(() => tc.ConvertFrom(1)); }
public void WhenValueIsNull_ThenThrowException() { var tc = new TinyTypeTypeConverter <ServerTaskId>(); Assert.Throws <ArgumentNullException>(() => tc.ConvertFrom(null)); }