public void AddEndpoint_registers_endpoint_for_given_binding(WcfServiceHostConfiguration <TestService> sut, GenericEndpointAddress endpointAddress, ServiceHost host)
        {
            sut.AddEndpoint <TestHttpBinding>(typeof(ITestService), endpointAddress);

            sut.ConfigureServiceHost(host);

            Assert.That(host.Description.Endpoints, Has.Exactly(1).InstanceOf <ServiceEndpoint>());
        }
        public void AddEndpoint_uses_binding_configuration_when_given(WcfServiceHostConfiguration <TestService> sut, GenericEndpointAddress endpointAddress, Action <TestHttpBinding> bindingConfiguration, ServiceHost host)
        {
            sut.AddEndpoint <TestHttpBinding>(typeof(ITestService), endpointAddress, bindingConfiguration);

            sut.ConfigureServiceHost(host);

            Mock.Get(bindingConfiguration).Verify(p => p(It.IsAny <TestHttpBinding>()), Times.Once);
        }
        public void ConfigureServiceHost_adds_custom_endpoint_behaviors(WcfServiceHostConfiguration <TestService> sut, ServiceHost host, GenericEndpointAddress endpointAddress, IEndpointBehavior endpointBehavior)
        {
            sut.AddEndpoint <TestHttpBinding>(typeof(ITestService), endpointAddress).Behaviors.Add(endpointBehavior);

            sut.ConfigureServiceHost(host);

            Assert.That(host.Description.Endpoints[0].Behaviors, Contains.Item(endpointBehavior));
        }