예제 #1
0
            public void TryConvertObject_RTypeIsNull_ReturnNull()
            {
                TestClass cacheItem = null;

                var returnItem = GenericConverter.TryConvertObject <TestClass>(cacheItem);

                Assert.IsNull(returnItem);
            }
예제 #2
0
            public void TryConvertObject_VTypeMismatch_ReturnZero()
            {
                TestClass cacheItem = new TestClass();

                int returnItem = GenericConverter.TryConvertObject <int>(cacheItem);

                Assert.AreEqual(returnItem, 0);
            }
예제 #3
0
            public void TryConvertObject_RTypeMismatch_ReturnNull()
            {
                int cacheItem = 10;

                var returnItem = GenericConverter.TryConvertObject <TestClass>(cacheItem);

                Assert.AreEqual(returnItem, null);
            }
예제 #4
0
            public void TryConvertObject_VTypeNoMismatch_ResultOk()
            {
                int cacheItem = 10;

                int returnItem = GenericConverter.TryConvertObject <int>(cacheItem);

                Assert.AreEqual(cacheItem, returnItem);
            }
예제 #5
0
            public void TryConvertObject_RTypeNoMismatch_ReturnNull()
            {
                TestClass cacheItem = new TestClass();

                var returnItem = GenericConverter.TryConvertObject <TestClass>(cacheItem);

                Assert.NotNull(returnItem);
                Assert.AreEqual(returnItem.Test, cacheItem.Test);
            }