public void TryConvertObject_RTypeIsNull_ReturnNull() { TestClass cacheItem = null; var returnItem = GenericConverter.TryConvertObject <TestClass>(cacheItem); Assert.IsNull(returnItem); }
public void TryConvertObject_VTypeMismatch_ReturnZero() { TestClass cacheItem = new TestClass(); int returnItem = GenericConverter.TryConvertObject <int>(cacheItem); Assert.AreEqual(returnItem, 0); }
public void TryConvertObject_RTypeMismatch_ReturnNull() { int cacheItem = 10; var returnItem = GenericConverter.TryConvertObject <TestClass>(cacheItem); Assert.AreEqual(returnItem, null); }
public void TryConvertObject_VTypeNoMismatch_ResultOk() { int cacheItem = 10; int returnItem = GenericConverter.TryConvertObject <int>(cacheItem); Assert.AreEqual(cacheItem, returnItem); }
public void TryConvertObject_RTypeNoMismatch_ReturnNull() { TestClass cacheItem = new TestClass(); var returnItem = GenericConverter.TryConvertObject <TestClass>(cacheItem); Assert.NotNull(returnItem); Assert.AreEqual(returnItem.Test, cacheItem.Test); }