Exemplo n.º 1
0
        public void GetFailingCheckNames_WhenNoResults_ReturnsEmptyArray()
        {
            var sut    = new NimatorResult(DateTime.Now);
            var result = sut.GetFailingCheckNames();

            CollectionAssert.IsEmpty(result);
        }
Exemplo n.º 2
0
        public void GetFailingCheckNames_WhenErrorsAvailable_ReturnsNames()
        {
            var sut = new NimatorResult(DateTime.Now);

            sut.LayerResults.Add(new LayerResult("A", new[] {
                new CheckResult("c1", NotificationLevel.Okay),
                new CheckResult("c2", NotificationLevel.Warning),
                new CheckResult("c3", NotificationLevel.Error),
                new CheckResult("c4", NotificationLevel.Critical),
            }));

            sut.LayerResults.Add(new LayerResult("B", new[] {
                new CheckResult("c5", NotificationLevel.Okay),
                new CheckResult("c6", NotificationLevel.Warning),
                new CheckResult("c7", NotificationLevel.Error),
                new CheckResult("c8", NotificationLevel.Critical),
            }));

            var result = sut.GetFailingCheckNames();

            CollectionAssert.AreEquivalent(new[] { "c3", "c4", "c7", "c8" }, result);
        }