示例#1
0
        public void InitializeMethodIsCalledWithProperties()
        {
            var         serverFactory = new InitializePatternTwo();
            var         adapter       = new ServerFactoryAdapter(serverFactory);
            IAppBuilder builder       = new AppBuilderFactory().Create();

            adapter.Initialize(builder);
            builder.Properties["called"].ShouldBe(serverFactory);
        }
示例#2
0
        public void CreateMethodCalledWithAppAndProperties()
        {
            var         serverFactory = new CreatePatternOne();
            var         adapter       = new ServerFactoryAdapter(serverFactory);
            IAppBuilder builder       = new AppBuilderFactory().Create();
            IDisposable disposable    = adapter.Create(builder);

            builder.Properties["called"].ShouldBe(serverFactory);
            builder.Properties["app"].ShouldNotBe(null);
            builder.Properties["properties"].ShouldBeSameAs(builder.Properties);
            disposable.ShouldBe(serverFactory);
        }