Example #1
0
        public Test_WebService(ComposedFixture fixture)
        {
            TestHelper.ResetDocker(this.GetType());

            this.composedFixture = fixture;

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

                composedFixture.AddServiceFixture("web-0", new NeonServiceFixture <WebService>(), () => CreateService("web-0"));
                composedFixture.AddServiceFixture("web-1", new NeonServiceFixture <WebService>(), () => CreateService("web-1"));
            });

            this.natsFixture = (NatsFixture)composedFixture["nats"];
            this.web0        = (NeonServiceFixture <WebService>)composedFixture["web-0"];
            this.web1        = (NeonServiceFixture <WebService>)composedFixture["web-1"];

            connection       = CreateConnection(web0.Service.ServiceMap["web-0"].Endpoints.Default.Uri + "echo", HttpTransportType.WebSockets, userName: "******");
            secondConnection = CreateConnection(web1.Service.ServiceMap["web-1"].Endpoints.Default.Uri + "echo", HttpTransportType.WebSockets, userName: "******");
            thirdConnection  = CreateConnection(web1.Service.ServiceMap["web-0"].Endpoints.Default.Uri + "echo", HttpTransportType.WebSockets, userName: "******");
            fourthConnection = CreateConnection(web1.Service.ServiceMap["web-1"].Endpoints.Default.Uri + "echo", HttpTransportType.WebSockets, userName: "******");
        }
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");
            }
        }
Example #3
0
        public Test_QueueService(ComposedFixture fixture)
        {
            this.composedFixture = fixture;

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

                composedFixture.AddServiceFixture("queue-service", new KubeServiceFixture <QueueService>(), () => CreateQueueService());
            });

            this.natsFixture         = (NatsFixture)composedFixture["nats"];
            this.queueServiceFixture = (KubeServiceFixture <QueueService>)composedFixture["queue-service"];
        }
Example #4
0
        public Test_QueueService(ComposedFixture fixture)
        {
            TestHelper.ResetDocker(this.GetType());

            this.composedFixture = fixture;

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

                composedFixture.AddServiceFixture("queue-service", new NeonServiceFixture <QueueService>(), () => CreateQueueService());
            });

            this.natsFixture         = (NatsFixture)composedFixture["nats"];
            this.queueServiceFixture = (NeonServiceFixture <QueueService>)composedFixture["queue-service"];
        }