Beispiel #1
0
        public void CreateComplex_MustOk()
        {
            var root = ConfigHelper.CreateEmptyRoot();
            var c    = BinderConfigurationExtensions.CreateComplexProxy <ComplexClass>(root);

            Assert.IsNotNull(c);
        }
Beispiel #2
0
        public void GivenNullCall_MustThrowException()
        {
            var root = ConfigHelper.CreateEmptyRoot();

            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.AutoCreateProxy <object>(null));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.AutoCreateProxy(root, null));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateComplexProxy <object>(null));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateComplexProxy(root, null));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateProxy <object>(null));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateProxy <object>(null, null));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateProxy(root, null));

            Assert.ThrowsException <ArgumentException>(() => BinderConfigurationExtensions.AutoCreateProxy <object>(root, (string)null));
            Assert.ThrowsException <ArgumentException>(() => BinderConfigurationExtensions.AutoCreateProxy <object>(root, null, NullNameTransfer.Instance));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.AutoCreateProxy(root, null, "dwadw"));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.AutoCreateProxy(root, null, "dwadw", NullNameTransfer.Instance));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateProxy <object>(null, NullNameTransfer.Instance));
            Assert.ThrowsException <ArgumentNullException>(() => BinderConfigurationExtensions.CreateProxy(root, null, NullNameTransfer.Instance));
        }