Example #1
0
        public void RegisterMonitorType_should_register_new_types_and_ignore_currently_existing_ones()
        {
            _repository.Setup(r => r.LoadMonitorTypes()).Returns(new[] { "abc" });

            var registry = new HealthMonitorTypeRegistry(_repository.Object);

            Assert.Equal(new[] { "abc" }, registry.GetMonitorTypes().OrderBy(t => t));

            registry.RegisterMonitorType("def");
            registry.RegisterMonitorType("abc");
            registry.RegisterMonitorType("ghi");
            Assert.Equal(new[] { "abc", "def", "ghi" }, registry.GetMonitorTypes().OrderBy(t => t));
        }
Example #2
0
        public void GetMonitorTypes_should_return_all_currently_registered_monitors()
        {
            _repository.Setup(r => r.LoadMonitorTypes()).Returns(new[] { "abc", "def" });
            var registry = new HealthMonitorTypeRegistry(_repository.Object);

            registry.RegisterMonitorType("ghi");
            Assert.Equal(new[] { "abc", "def", "ghi" }, registry.GetMonitorTypes().OrderBy(t => t));
        }