public void Type_Configuration_NotSet()
        {
            // Arrange
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();
            var environment     = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var typeName = environment.Type;

            // Assert
            Assert.False(string.IsNullOrWhiteSpace(typeName));
        }
        public void LogStreamName_Configuration_NotSet()
        {
            // Arrange
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();
            var environment     = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var streamName = environment.LogStreamName;

            // Assert
            Assert.Equal(string.Empty, streamName);
        }
        public void Probe_False()
        {
            // Arrange
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();

            resourceFetcher.Fetch <ECSMetadata>(Arg.Any <Uri>()).Throws <EMFClientException>();
            var environment = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var result = environment.Probe();

            // Assert
            Assert.False(result);
        }
        public void LogStreamName_Configuration_Set()
        {
            // Arrange
            var logStreamName   = "TestServiceType";
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();

            configuration.LogStreamName.Returns(logStreamName);
            var environment = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var streamName = environment.LogStreamName;

            // Assert
            Assert.Equal(logStreamName, streamName);
        }
        public void Type_Configuration_Set()
        {
            // Arrange
            var type            = "TestServiceType";
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();

            configuration.ServiceType = type;
            var environment = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var typeName = environment.Type;

            // Assert
            Assert.Equal(type, typeName);
        }
        public void Name_Configuration_Set()
        {
            // Arrange
            var name            = "TestService";
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();

            configuration.ServiceName = name;
            var environment = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var environmentName = environment.Name;

            // Assert
            Assert.Equal(name, environmentName);
        }
        public void LogGroupName_Configuration_Set()
        {
            // Arrange
            var logGroupName    = "TestLogGroup";
            var configuration   = _fixture.Create <IConfiguration>();
            var resourceFetcher = _fixture.Create <IResourceFetcher>();

            configuration.LogGroupName = logGroupName;
            var environment = new ECSEnvironment(configuration, resourceFetcher);

            // Act
            var groupName = environment.LogGroupName;

            // Assert
            Assert.Equal(logGroupName, groupName);
        }