Ejemplo n.º 1
0
        public void CreateTest()
        {
            const string expectedId     = "BDCD9400-2C37-4832-ACAE-008284FCB6E2";
            const string expectedDetail = "Test Detail Test";
            var          notification   = NotFoundNotification.Create(expectedId, expectedDetail);

            Assert.AreEqual(expectedId, notification.Id);
            Assert.AreEqual(expectedDetail, notification.Detail);
            Assert.AreEqual(Notification.SeverityType.Error, notification.Severity);
        }
Ejemplo n.º 2
0
        private static IEnumerable <object[]> SetupIsNotFoundTest()
        {
            const bool isNotFoundTrue  = true;
            const bool isNotFoundFalse = false;

            yield return(new object[]
            {
                "3 not found",
                new List <Notification>
                {
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail)
                },
                isNotFoundTrue
            });

            yield return(new object[]
            {
                "2 not found",
                new List <Notification>
                {
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail)
                },
                isNotFoundTrue
            });

            yield return(new object[]
            {
                "1 not found",
                new List <Notification>
                {
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail),
                    Notification.CreateWarning(ExpectedId, ExpectedDetail)
                },
                isNotFoundTrue
            });

            yield return(new object[]
            {
                "0 not found",
                new List <Notification>
                {
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    Notification.CreateInfo(ExpectedId, ExpectedDetail),
                    Notification.CreateWarning(ExpectedId, ExpectedDetail)
                },
                isNotFoundFalse
            });
        }
Ejemplo n.º 3
0
        private static IEnumerable <object[]> SetupHasErrorsTest()
        {
            const bool hasErrorsTrue  = true;
            const bool hasErrorsFalse = false;

            yield return(new object[]
            {
                "3 errors",
                new List <Notification>
                {
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail)
                },
                hasErrorsTrue
            });

            yield return(new object[]
            {
                "2 errors",
                new List <Notification>
                {
                    Notification.CreateInfo(ExpectedId, ExpectedDetail),
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    NotFoundNotification.Create(ExpectedId, ExpectedDetail)
                },
                hasErrorsTrue
            });

            yield return(new object[]
            {
                "1 errors",
                new List <Notification>
                {
                    Notification.CreateInfo(ExpectedId, ExpectedDetail),
                    Notification.CreateError(ExpectedId, ExpectedDetail),
                    Notification.CreateWarning(ExpectedId, ExpectedDetail)
                },
                hasErrorsTrue
            });

            yield return(new object[]
            {
                "0 errors",
                new List <Notification>
                {
                    Notification.CreateInfo(ExpectedId, ExpectedDetail),
                    Notification.CreateInfo(ExpectedId, ExpectedDetail),
                    Notification.CreateWarning(ExpectedId, ExpectedDetail)
                },
                hasErrorsFalse
            });
        }