Пример #1
0
        public void ConvertBackThrowsException()
        {
            // Arrange
            var conv = new NotNull();

            // Act
            var ex = ExceptionAssert.Catch <NotSupportedException>(() => conv.ConvertBack(null, null, null, null));

            // Assert
            Assert.IsNotNull(ex);
        }
Пример #2
0
        public void Converter_NotNullTests()
        {
            NotNull conv = new NotNull();

            Assert.AreEqual(true, conv.Convert(new object(), typeof(bool), null, CultureInfo.CurrentCulture),
                            "NotNull Convert did not return the correct value");
            Assert.AreEqual(false, conv.Convert(null, typeof(bool), null, CultureInfo.CurrentCulture),
                            "NotNull Convert did not return the correct value");
            try
            {
                conv.ConvertBack(true, typeof(object), null, CultureInfo.CurrentCulture);
                Assert.Fail("NotNull ConvertBack did not throw a NotImplemented exception");
            }
            catch (NotImplementedException) { }
        }