Exemplo n.º 1
0
        public void Constructor_ExpectedValues()
        {
            // Call
            var provider = new DesignWaterLevelCalculationMessageProvider("1/10000");

            // Assert
            Assert.IsInstanceOf <ICalculationMessageProvider>(provider);
        }
Exemplo n.º 2
0
        public void GetActivityDescription_VariousParameters_ReturnsExpectedValue(string name)
        {
            // Setup
            const string calculationIdentifier = "1/10000";
            var          provider = new DesignWaterLevelCalculationMessageProvider(calculationIdentifier);

            // Call
            string description = provider.GetActivityDescription(name);

            // Assert
            string expectedDescription = $"Waterstand berekenen voor locatie '{name}' ({calculationIdentifier})";

            Assert.AreEqual(expectedDescription, description);
        }
Exemplo n.º 3
0
        public void GetCalculatedNotConvergedMessage_VariousParameters_ReturnsExpectedValue(string name)
        {
            // Setup
            const string calculationIdentifier = "1/10000";
            var          provider = new DesignWaterLevelCalculationMessageProvider(calculationIdentifier);

            // Call
            string message = provider.GetCalculatedNotConvergedMessage(name);

            // Assert
            string expectedMessage = $"Waterstand berekening voor locatie '{name}' ({calculationIdentifier}) is niet geconvergeerd.";

            Assert.AreEqual(expectedMessage, message);
        }
Exemplo n.º 4
0
        public void GetCalculationFailedMessage_VariousParameters_ReturnsExpectedValue(string name)
        {
            // Setup
            const string calculationIdentifier = "1/10000";
            var          provider = new DesignWaterLevelCalculationMessageProvider(calculationIdentifier);

            // Call
            string message = provider.GetCalculationFailedMessage(name);

            // Assert
            string expectedMessage = $"Er is een fout opgetreden tijdens de waterstand berekening voor locatie '{name}' ({calculationIdentifier}). " +
                                     "Er is geen foutrapport beschikbaar.";

            Assert.AreEqual(expectedMessage, message);
        }
Exemplo n.º 5
0
        public void GetCalculationFailedWithErrorReportMessage_ValidNames_ExpectedValues(string name)
        {
            // Setup
            const string calculationIdentifier = "1/10000";
            var          provider       = new DesignWaterLevelCalculationMessageProvider(calculationIdentifier);
            const string failureMessage = "It failed";

            // Call
            string message = provider.GetCalculationFailedWithErrorReportMessage(name, failureMessage);

            // Assert
            string expectedMessage = $"Er is een fout opgetreden tijdens de waterstand berekening voor locatie '{name}' ({calculationIdentifier}). " +
                                     $"Bekijk het foutrapport door op details te klikken.{Environment.NewLine}{failureMessage}";

            Assert.AreEqual(expectedMessage, message);
        }