public void CreateWcfProxy_TargetDoesNotImplementInterface() { var generator = new ServiceHostProxyGenerator(); object target = new NotAServiceImplementation(); Type interfaceToProxy = typeof(IServiceContract); Assert.Throws <ArgumentException>(() => generator.CreateWcfProxy(interfaceToProxy, target)); }
public void CreateWcfProxy_NullTarget() { var generator = new ServiceHostProxyGenerator(); object target = null; Type interfaceToProxy = typeof(IServiceContract); Assert.Throws <ArgumentNullException>(() => generator.CreateWcfProxy(interfaceToProxy, target)); }
public void CreateWcfProxy_NullInterface() { var generator = new ServiceHostProxyGenerator(); object target = new ServiceImplementation(); Type interfaceToProxy = null; Assert.Throws <ArgumentNullException>(() => generator.CreateWcfProxy(interfaceToProxy, target)); }
public void CreateWcfProxy_CustomProxyTypeCanBeHosted() { var generator = new ServiceHostProxyGenerator(); object target = new ServiceImplementation(); Type interfaceToProxy = typeof(IServiceContract); var proxy = generator.CreateWcfProxy(interfaceToProxy, target); // XUnit does not have "Assert.DoesNotThrow". new ServiceHost(proxy.GetType(), new Uri("http://localhost:22111/Foo.svc")); }
public void Ctor_ProxyBuilderIsServiceHostProxyBuilder() { var generator = new ServiceHostProxyGenerator(); Assert.IsType <ServiceHostProxyBuilder>(generator.ProxyBuilder); }