示例#1
0
        public void CopyAmountFromConfirmation_WhenConfirmationHasIncorrectFormat_ThenThrowsApplicationException()
        {
            var euroPolicy      = new EuroPolicy();
            var rewriterService = new RewriterService(StubConfirmation.IncorrectFormat());

            Assert.Throws <ApplicationException>(() => rewriterService.CopyAmountFromConfirmation(euroPolicy));
        }
示例#2
0
        public void CopyPassengersFromConfirmation_WhenConfirmationHasCorrectFormat_ThenReturnsCorrectValue()
        {
            var rewriterService = new RewriterService(StubConfirmation.PLNVersion());

            var actualPassengers = rewriterService.CopyPassengersFromConfirmation();

            Assert.AreEqual(expectedPassengers, actualPassengers);
        }
        public void CopyTravelNumberFromConfirmation_WhenConfirmationHasCorrectFormat_ThenReturnsCorrectValue()
        {
            var rewriterService = new RewriterService(StubConfirmation.PLNVersion());

            var actualTravelNumber = rewriterService.CopyTravelNumberFromConfirmation();

            Assert.AreEqual("HTG93P", actualTravelNumber);
        }
示例#4
0
        public void CopyAmountFromConfirmation_WhenConfirmationContainAmountInPlnFormat_ThenReturnsCorrectValue()
        {
            var plnPolicy       = new PlnPolicy();
            var rewriterService = new RewriterService(StubConfirmation.PLNVersion());

            var actualAmount = rewriterService.CopyAmountFromConfirmation(plnPolicy);

            Assert.AreEqual(expected: 1645.27m, actualAmount.Value);
        }
示例#5
0
        public void CopyAmountFromConfirmation_WhenConfirmationContainAmountInEuroFormat_ThenReturnsCorrectValue()
        {
            var euroPolicy      = new EuroPolicy();
            var rewriterService = new RewriterService(StubConfirmation.EURVersion());

            Console.WriteLine(StubConfirmation.EURVersion().Content);

            var actualAmount = rewriterService.CopyAmountFromConfirmation(euroPolicy);

            Assert.AreEqual(expected: 1645.27m, actualAmount.Value);
        }
示例#6
0
        public void CopyPassengersFromConfirmation_WhenConfirmationHasIncorrectFormat_ThenThrowsApplicationException()
        {
            var rewriterService = new RewriterService(StubConfirmation.IncorrectFormat());

            Assert.Throws <ApplicationException>(() => rewriterService.CopyPassengersFromConfirmation());
        }
示例#7
0
        public void IsTemplateCorrect_WhenTemplateInEuroVersionIsCorrect_ThenReturnsTrue()
        {
            var specyficationEuro = new ConfirmationTemplateSpecyfication(new EuroPolicy());

            Assert.True(specyficationEuro.IsTemplateCorrect(StubConfirmation.EURVersion()));
        }
示例#8
0
        public void IsTemplateCorrect_WhenTemplateInEuroVersionIsIncorrect_ThenReturnsFalse()
        {
            var specyficationEuro = new ConfirmationTemplateSpecyfication(new EuroPolicy());

            Assert.False(specyficationEuro.IsTemplateCorrect(StubConfirmation.IncorrectFormat()));
        }
        public void IsTemplateCorrect_WhenTemplateInPlnVersionIsInOtherFormat_ThenReturnsFalse()
        {
            var specyficationEuro = new ConfirmationTemplateSpecyfication(new PlnPolicy());

            Assert.False(specyficationEuro.IsTemplateCorrect(StubConfirmation.EURVersion()));
        }