Esempio n. 1
0
        public void VoucherFileFormatHandler_ParseFileLine_InvalidLineData_ErrorIsThrown(String lineData)
        {
            VoucherFileFormatHandler voucherFileFormatHandler = new VoucherFileFormatHandler();

            Should.Throw <InvalidDataException>(() =>
            {
                voucherFileFormatHandler.ParseFileLine(lineData);
            });
        }
Esempio n. 2
0
        public void VoucherFileFormatHandler_ParseFileLine_MobileNumber_LineIsParsed()
        {
            VoucherFileFormatHandler voucherFileFormatHandler = new VoucherFileFormatHandler();

            Dictionary <String, String> transactionMetaData = voucherFileFormatHandler.ParseFileLine(TestData.VoucherDetailLineWithMobileNumber);

            transactionMetaData.TryGetValue("OperatorName", out String operatorName);
            transactionMetaData.TryGetValue("Amount", out String amount);
            transactionMetaData.TryGetValue("RecipientMobile", out String recipientMobile);

            operatorName.ShouldNotBeNullOrEmpty();
            operatorName.ShouldBe(TestData.VoucherOperatorIdentifier);
            amount.ShouldNotBeNullOrEmpty();
            amount.ShouldBe(TestData.VoucherDetailLineAmount);
            recipientMobile.ShouldNotBeNullOrEmpty();
            recipientMobile.ShouldBe(TestData.VoucherRecipientMobile);
        }