public Test_ComposingFixtures(ComposedFixture composedFixture)
        {
            this.composedFixture = composedFixture;

            composedFixture.Start(
                () =>
            {
                composedFixture.AddFixture("aspNet", new AspNetFixture(),
                                           aspNetFixture =>
                {
                    aspNetFixture.StartAsComposed <Startup>();
                });

                composedFixture.AddFixture("natsStreaming", new NatsStreamingFixture(),
                                           natsStreamingFixture =>
                {
                    natsStreamingFixture.StartAsComposed();
                });

                composedFixture.AddFixture("couchbase", new CouchbaseFixture(),
                                           couchbaseFixture =>
                {
                    couchbaseFixture.StartAsComposed();
                });
            });

            this.aspNetFixture        = (AspNetFixture)composedFixture["aspNet"];
            this.natsStreamingFixture = (NatsStreamingFixture)composedFixture["natsStreaming"];
            this.couchbaseFixture     = (CouchbaseFixture)composedFixture["couchbase"];
        }
Example #2
0
        public Test_ComposedFixture(ComposedFixture composedFixture)
        {
            this.composedFixture = composedFixture;

            var fixtureStatus = composedFixture.Start(
                () =>
            {
                // NOTE: Adding this one first because it clears the local Docker
                //       state when it starts and we want the containers started
                //       by the other fixtures to be unmolested.

                composedFixture.AddFixture("docker", new DockerFixture());

                composedFixture.AddFixture("aspNet", new AspNetFixture(),
                                           aspNetFixture =>
                {
                    aspNetFixture.StartAsComposed <Startup>();
                });

                composedFixture.AddFixture("container", new ContainerFixture(),
                                           containerFixture =>
                {
                    containerFixture.StartAsComposed("my-container", $"{NeonHelper.NeonLibraryBranchRegistry}/test:latest");
                });

                composedFixture.AddFixture("hosts", new HostsFixture());

                composedFixture.AddFixture("nats", new NatsFixture(),
                                           natsFixture =>
                {
                    natsFixture.StartAsComposed();
                });
            });

            this.aspNetFixture    = (AspNetFixture)composedFixture["aspNet"];
            this.dockerFixture    = (DockerFixture)composedFixture["docker"];
            this.containerFixture = (ContainerFixture)composedFixture["container"];
            this.hostsFixture     = (HostsFixture)composedFixture["hosts"];
            this.natsFixture      = (NatsFixture)composedFixture["nats"];

            if (fixtureStatus == TestFixtureStatus.Started)
            {
                hostsFixture.AddHostAddress("foo.bar", "127.1.2.3");
            }
        }