Exemplo n.º 1
0
        public void AddTicketingConnector_Returns_Service_WithNo_TicketingSystem_When_ConnectorConfigNull()
        {
            var mockServices = new SpyServiceCollection();
            var mockEnv      = new Mock <IHostingEnvironment>();
            var mockConfig   = new Mock <IConfigurationRoot>();

            var result = mockServices.AddTicketingConnector(mockEnv.Object,
                                                            mockConfig.Object,
                                                            null);
            var finalResult = result.ToArray();

            Assert.AreEqual(finalResult[0].ImplementationType.Name, "NoClient");
            Assert.AreEqual(finalResult[1].ImplementationType.Name, "NoConnector");
        }
Exemplo n.º 2
0
        public void AddTicketingConnector_ReturnsServiceWithNoTicketingSystem_WhenConnectorConfigPathIsWhiteSpace()
        {
            var mockServices        = new SpyServiceCollection();
            var mockEnv             = new Mock <IHostingEnvironment>();
            var mockConfig          = new Mock <IConfigurationRoot>();
            var mockConnectorConfig = new TicketingConnectorConfig()
            {
                Path = ""
            };

            var result = mockServices.AddTicketingConnector(mockEnv.Object,
                                                            mockConfig.Object,
                                                            mockConnectorConfig);
            var finalResult = result.ToArray();

            Assert.AreEqual(finalResult[0].ImplementationType.Name, "NoClient");
            Assert.AreEqual(finalResult[1].ImplementationType.Name, "NoConnector");
        }