コード例 #1
0
        public void listens_and_finishes_after_receiving_the_all_clear()
        {
            // trying to get the asset pipeline to shut up about
            // non-existent assets
            var settings = new ApplicationSettings
            {
                PhysicalPath = Environment.CurrentDirectory
                               .ParentDirectory().ParentDirectory().ParentDirectory()
                               .AppendPath("RemoteService")
            };

            var system = new FubuMvcSystem(() => FubuRuntime.Basic());

            system.AddRemoteSubSystem("Remote", x => { x.UseParallelServiceDirectory("RemoteService"); });

            using (var context = system.CreateContext())
            {
                system.StartListeningForMessages();
                var message = new RemoteGo();
                MessageHistory.Record(MessageTrack.ForSent(message));

                var waitForWorkToFinish =
                    MessageHistory.WaitForWorkToFinish(
                        () => { system.RemoteSubSystemFor("Remote").Runner.SendRemotely(message); }, 30000);
                waitForWorkToFinish.ShouldBeTrue();
            }
        }
        public void listens_and_finishes_after_receiving_the_all_clear()
        {
            // trying to get the asset pipeline to shut up about
            // non-existent assets
            var settings = new ApplicationSettings
            {
                PhysicalPath = Environment.CurrentDirectory
                    .ParentDirectory().ParentDirectory().ParentDirectory()
                    .AppendPath("RemoteService")
            };

            var system = new FubuMvcSystem(settings, () => FubuApplication.DefaultPolicies().StructureMap().Bootstrap());

            system.AddRemoteSubSystem("Remote", x => {
                x.UseParallelServiceDirectory("RemoteService");
            });

            using (var context = system.CreateContext())
            {
                system.StartListeningForMessages();
                var message = new RemoteGo();
                MessageHistory.Record(MessageTrack.ForSent(message));

                var waitForWorkToFinish = MessageHistory.WaitForWorkToFinish(() => {
                    system.RemoteSubSystemFor("Remote").Runner.SendRemotely(message);
                }, timeoutMilliseconds:30000);
                waitForWorkToFinish.ShouldBeTrue();
            }
        }
コード例 #3
0
 public void uses_explicit_physical_path_if_if_exists()
 {
     using (var system = new FubuMvcSystem <TargetApplication>(physicalPath: "c:\\foo"))
     {
         system.Settings.PhysicalPath.ShouldBe("c:\\foo");
     }
 }
コード例 #4
0
 public void use_default_physical_path_if_none_given()
 {
     using (var system = new FubuMvcSystem <KayakApplication>())
     {
         // assembly name
         system.Settings.PhysicalPath.ShouldEndWith("KayakTestApplication");
     }
 }
コード例 #5
0
 public void parallel_path()
 {
     using (var system = new FubuMvcSystem <KayakApplication>("foo"))
     {
         // assembly name
         system.Settings.PhysicalPath.ShouldEndWith("foo");
     }
 }
コード例 #6
0
 public void parallel_path()
 {
     using (var system = new FubuMvcSystem<KayakApplication>("foo"))
     {
         // assembly name
         system.Settings.PhysicalPath.ShouldEndWith("foo");
     }
 }
コード例 #7
0
        public void register_a_remote_subsystem()
        {
            var system = new FubuMvcSystem(() => null);

            system.AddRemoteSubSystem("foo", x => { });

            system.RemoteSubSystemFor("foo").ShouldNotBeNull();
            system.SubSystems.OfType <RemoteSubSystem>().Single().ShouldBeOfType <RemoteSubSystem>();
        }
コード例 #8
0
        public void modify_the_underlying_container()
        {
            using (var system = new FubuMvcSystem<TargetApplication>())
            {
                system.ModifyContainer(x => x.For<IColor>().Use<Green>());

                system.CreateContext().GetService<IColor>()
                    .ShouldBeOfType<Green>();
            }
        }
コード例 #9
0
        public void modify_the_underlying_container()
        {
            using (var system = new FubuMvcSystem <TargetApplication>())
            {
                system.ModifyContainer(x => x.For <IColor>().Use <Green>());

                system.CreateContext().GetService <IColor>()
                .ShouldBeOfType <Green>();
            }
        }
コード例 #10
0
        public void registers_the_IRemoveSubsystems_with_the_container()
        {
            FubuMvcPackageFacility.PhysicalRootPath = ".".ToFullPath();

            using (var system = new FubuMvcSystem <TargetApplication>())
            {
                using (var context = system.CreateContext())
                {
                    context.Services.GetInstance <IRemoteSubsystems>()
                    .ShouldBeTheSameAs(system);
                }
            }
        }
コード例 #11
0
        public void registers_the_IRemoveSubsystems_with_the_container()
        {
            //FubuApplication.RootPath = ".".ToFullPath();

            using (var system = new FubuMvcSystem <TargetApplication>())
            {
                using (var context = system.CreateContext())
                {
                    context.GetService <IRemoteSubsystems>()
                    .ShouldBeTheSameAs(system);
                }
            }
        }
コード例 #12
0
        public void registers_the_IRemoveSubsystems_with_the_container()
        {
            //FubuApplication.RootPath = ".".ToFullPath();

            using (var system = new FubuMvcSystem<TargetApplication>())
            {
                using (var context = system.CreateContext())
                {
                    context.GetService<IRemoteSubsystems>()
                        .ShouldBeTheSameAs(system);
                }
            }
        }
コード例 #13
0
        public void works_with_the_contextual_providers()
        {
            using (var system = new FubuMvcSystem <TargetApplication>())
            {
                system.ModifyContainer(x => {
                    x.For <IContextualInfoProvider>().Add(new FakeContextualProvider("red", "green"));
                    x.For <IContextualInfoProvider>().Add(new FakeContextualProvider("blue", "orange"));
                });

                system.CreateContext().As <IResultsExtension>()
                .Tags().Select(x => x.Text())
                .ShouldHaveTheSameElementsAs("red", "green", "blue", "orange");
            }
        }
コード例 #14
0
        public void can_recycle()
        {
            using (var system = new FubuMvcSystem<TargetApplication>())
            {
                using (var context = system.CreateContext())
                {
                    context.GetService<IApplicationUnderTest>().ShouldNotBeNull();
                    system.Recycle();
                    context.GetService<IApplicationUnderTest>().ShouldNotBeNull();
                }

                using (var context = system.CreateContext())
                {
                    context.GetService<IApplicationUnderTest>().ShouldNotBeNull();
                    system.Recycle();
                    context.GetService<IApplicationUnderTest>().ShouldNotBeNull();
                }
            }
        }
コード例 #15
0
        public void can_recycle()
        {
            using (var system = new FubuMvcSystem <TargetApplication>())
            {
                using (var context = system.CreateContext())
                {
                    context.GetService <IApplicationUnderTest>().ShouldNotBeNull();
                    system.Recycle();
                    context.GetService <IApplicationUnderTest>().ShouldNotBeNull();
                }

                using (var context = system.CreateContext())
                {
                    context.GetService <IApplicationUnderTest>().ShouldNotBeNull();
                    system.Recycle();
                    context.GetService <IApplicationUnderTest>().ShouldNotBeNull();
                }
            }
        }
コード例 #16
0
        public void register_a_remote_subsystem()
        {
            var system = new FubuMvcSystem(() => null);
            system.AddRemoteSubSystem("foo", x => { });

            system.RemoteSubSystemFor("foo").ShouldNotBeNull();
            system.SubSystems.OfType<RemoteSubSystem>().Single().ShouldBeOfType<RemoteSubSystem>();
        }
コード例 #17
0
 public void SetUp()
 {
     theSystem = new FubuMvcSystem(() => { return null; });
     theSystem.DefaultBrowser = BrowserType.Chrome;
 }
コード例 #18
0
 public void SetUp()
 {
     theSystem = new FubuMvcSystem <KayakApplication>();
 }
コード例 #19
0
 public void SetUp()
 {
     theSystem = new FubuMvcSystem<KayakApplication>();
 }
コード例 #20
0
 public void SetUp()
 {
     theSystem = new FubuMvcSystem(new ApplicationSettings(), () => { return(null); });
     theSystem.DefaultBrowser = BrowserType.Chrome;
 }
コード例 #21
0
 public void use_default_physical_path_if_none_given()
 {
     using (var system = new FubuMvcSystem<KayakApplication>())
     {
         // assembly name
         system.Settings.PhysicalPath.ShouldEndWith("KayakTestApplication");
     }
 }
コード例 #22
0
        public void works_with_the_contextual_providers()
        {
            using (var system = new FubuMvcSystem<TargetApplication>())
            {
                system.ModifyContainer(x => {
                    x.For<IContextualInfoProvider>().Add(new FakeContextualProvider("red", "green"));
                    x.For<IContextualInfoProvider>().Add(new FakeContextualProvider("blue", "orange"));
                });

                system.CreateContext().As<IResultsExtension>()
                    .Tags().Select(x => x.Text())
                    .ShouldHaveTheSameElementsAs("red", "green", "blue", "orange");
            }
        }
コード例 #23
0
 public void uses_explicit_physical_path_if_if_exists()
 {
     using (var system = new FubuMvcSystem<TargetApplication>(physicalPath: "c:\\foo"))
     {
         system.Settings.PhysicalPath.ShouldBe("c:\\foo");
     }
 }
コード例 #24
0
        public void registers_the_IRemoveSubsystems_with_the_container()
        {
            FubuMvcPackageFacility.PhysicalRootPath = ".".ToFullPath();

            using (
                var system = new FubuMvcSystem<TargetApplication>()
                )
            {
                using (var context = system.CreateContext())
                {
                    context.Services.GetInstance<IRemoteSubsystems>()
                        .ShouldBeTheSameAs(system);
                }
            }
        }
コード例 #25
0
 public void SetUp()
 {
     theSystem = new FubuMvcSystem(new ApplicationSettings(), () => { return null; });
     theSystem.DefaultBrowser = BrowserType.Chrome;
 }
コード例 #26
0
 public void SetUp()
 {
     theSystem = new FubuMvcSystem(() => { return(null); });
     theSystem.DefaultBrowser = BrowserType.Chrome;
 }