public void AddCollector_PerformanceCounterCollector_CollectorIsInCollectionOfConfig()
        {
            // Arrange
            var store            = NewDocumentStore(configureStore: ConfigureTestStore);
            var config           = new CollectorConfigStored();
            var configRepository = Substitute.For <ICollectorConfigRepository>();

            configRepository.Get(Arg.Any <string>()).Returns(config);

            // Act
            var collectorCommand = new Fixture().Build <AddPerformanceCounterCollectorToConfigCommand>()
                                   .Create();
            var collectorConfigService = new CollectorConfigService(configRepository);

            collectorConfigService.AddCollectorAsync(config.Id, collectorCommand);

            // Assert
            config.Collectors.Should().AllBeOfType <PerformanceCounterCollector>();
        }
        public void AddCollector_MsSqlCountCollector_CollectorIsInCollectionOfConfig()
        {
            // Arrange
            var store            = NewDocumentStore(configureStore: ConfigureTestStore);
            var config           = new CollectorConfigStored();
            var configRepository = Substitute.For <ICollectorConfigRepository>();

            configRepository.Get(Arg.Any <string>()).Returns(config);

            // Act
            var collectorCommand = new Fixture().Build <AddSqlCountCollectorToConfigCommand>()
                                   .With(w => w.SourceProvider, SqlCollectorSourceProvider.MsSql)
                                   .Create();
            var collectorConfigService = new CollectorConfigService(configRepository);

            collectorConfigService.AddCollectorAsync(config.Id, collectorCommand);

            // Assert
            config.Collectors.Should().AllBeOfType <Implementation.Collectors.Sql.MsSql.CountCollector>();
        }
        public void AddCollector_RestApiCollector_CollectorIsInCollectionOfConfig()
        {
            // Arrange
            var store            = NewDocumentStore(configureStore: ConfigureTestStore);
            var config           = new CollectorConfigStored();
            var configRepository = Substitute.For <ICollectorConfigRepository>();

            configRepository.Get(Arg.Any <string>()).Returns(config);

            // Act
            var collectorCommand = new Fixture().Build <AddRestApiCollectorToConfigCommand>()
                                   .With(x => x.RequestUri, "https://github.com/t0ms3n/monytor")
                                   .Create();
            var collectorConfigService = new CollectorConfigService(configRepository);

            collectorConfigService.AddCollectorAsync(config.Id, collectorCommand);

            // Assert
            config.Collectors.Should().AllBeOfType <RestApiCollector>();
        }