public void when_invalid_endpoint_type_is_provided_via_hostargs_it_should_blow_up() { Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); hostArguments = new HostArguments(new string[0]) { EndpointConfigurationType = "I am an invalid type name" }; RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; }
public void when_invalid_endpoint_type_is_provided_via_hostargs_it_should_blow_up() { Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); hostArguments = new HostArguments(new string[0]) { EndpointConfigurationType = "I am an invalid type name" }; RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; }
public void when_endpoint_type_is_not_provided_via_hostargs_it_should_fall_through_to_other_modes_of_determining_endpoint_type() { Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); hostArguments = new HostArguments(new string[0]); // will match with config-based type RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; Assert.AreEqual(EndpointTypeDefinedInConfigurationFile, RetrievedEndpointType); }
when_endpoint_type_is_not_provided_via_hostargs_it_should_fall_through_to_other_modes_of_determining_endpoint_type () { Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); hostArguments = new HostArguments(new string[0]); // will match with config-based type RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; Assert.AreEqual(EndpointTypeDefinedInConfigurationFile, RetrievedEndpointType); }
public void when_endpoint_type_is_not_provided_via_hostArgs_it_should_fall_through_to_other_modes_of_determining_endpoint_type() { var endpointTypeDefinedInConfigurationFile = typeof(MyEndpointConfig); var endpointTypeDeterminer = new EndpointTypeDeterminer(new AssemblyScanner(), () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); var hostArguments = new HostArguments(new string[0]); // will match with config-based type var RetrievedEndpointType = endpointTypeDeterminer.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; Assert.AreEqual(endpointTypeDefinedInConfigurationFile, RetrievedEndpointType); }
public void when_endpoint_type_is_provided_via_hostargs_it_should_have_first_priority() { Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); hostArguments = new HostArguments(new string[0]) { EndpointConfigurationType = typeof(TestEndpointType).AssemblyQualifiedName }; RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; Assert.AreEqual(typeof(TestEndpointType), RetrievedEndpointType); }
public void when_endpoint_type_is_provided_via_hostargs_it_should_have_first_priority() { Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); hostArguments = new HostArguments(new string[0]) { EndpointConfigurationType = typeof (TestEndpointType).AssemblyQualifiedName }; RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; Assert.AreEqual(typeof (TestEndpointType), RetrievedEndpointType); }
public void when_invalid_endpoint_type_is_provided_via_hostArgs_it_should_blow_up() { var endpointTypeDeterminer = new EndpointTypeDeterminer(new AssemblyScanner(), () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); var hostArguments = new HostArguments(new string[0]) { EndpointConfigurationType = "I am an invalid type name" }; Assert.Throws <ConfigurationErrorsException>(() => { // ReSharper disable once UnusedVariable var type = endpointTypeDeterminer.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; }); }