public void VoucherFileFormatHandler_ParseFileLine_InvalidLineData_ErrorIsThrown(String lineData) { VoucherFileFormatHandler voucherFileFormatHandler = new VoucherFileFormatHandler(); Should.Throw <InvalidDataException>(() => { voucherFileFormatHandler.ParseFileLine(lineData); }); }
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); }
public void VoucherFileFormatHandler_FileLineCanBeIgnored_ResultIsAsExpected(String fileLine, Boolean isIgnored) { VoucherFileFormatHandler voucherFileFormatHandler = new VoucherFileFormatHandler(); voucherFileFormatHandler.FileLineCanBeIgnored(fileLine).ShouldBe(isIgnored); }