コード例 #1
0
        public void Create_ServiceShouldBeConfiguredAsOriginallyConfiguredInWebTest()
        {
            // Given
            var replacementServices = new ServiceCollection();

            // When
            var testServer        = AcceptanceTestServer.Create <WebAppSampleStartupWrapper>(replacementServices, ContentRoot);
            var enumerableService = testServer.GetService <IEnumerable>();

            // Then
            Assert.IsType <ArrayList>(enumerableService);
        }
コード例 #2
0
        public void Create_ServiceShouldBeConfiguredWithReplacement()
        {
            // Given
            var replacementServices = new ServiceCollection {
                new ServiceDescriptor(typeof(IEnumerable), new SortedList())
            };

            // When
            var testServer        = AcceptanceTestServer.Create <WebAppSampleStartupWrapper>(replacementServices, ContentRoot);
            var enumerableService = testServer.GetService <IEnumerable>();

            // Then
            Assert.IsType <SortedList>(enumerableService);
        }