コード例 #1
0
ファイル: TestValidator.cs プロジェクト: tuvoksg1/RulesEngine
 public void InitializeFixture()
 {
     _builder = UnitTestHelper.FakeBuilder.Object;
     _token = new CancellationToken();
     SuccessPledgeResult = new PledgeResult { FileHasValidRecords = true, TotalRecordsProcessed = 3};
     FailPledgeResult = new PledgeResult { FileHasInvalidRecords = true, TotalRecordsProcessed = 3 };
     PartialPledgeResult = new PledgeResult { FileHasValidRecords = true, FileHasInvalidRecords = true, TotalRecordsProcessed = 3 };
 }
コード例 #2
0
ファイル: FakePledge.cs プロジェクト: tuvoksg1/RulesEngine
        internal static Mock<IPledge> Initialize(MoqMockingKernel kernel)
        {
            SuccessPledgeResult = new PledgeResult { FileHasValidRecords = true, TotalRecordsProcessed = 3};
            FailPledgeResult = new PledgeResult { FileHasInvalidRecords = true, TotalRecordsProcessed = 3 };
            PartialPledgeResult = new PledgeResult { FileHasValidRecords = true, FileHasInvalidRecords = true, TotalRecordsProcessed = 3 };

            var pledge = kernel.GetMock<IPledge>();
            pledge.Setup(
                mock =>
                    mock.Run(FakeConfigurationManager.Configuration, It.IsAny<IRemoteJob>(),It.IsAny<string>())).Returns(SuccessPledgeResult);

            return pledge;
        }
コード例 #3
0
ファイル: TestValidator.cs プロジェクト: tuvoksg1/RulesEngine
 private void RunTestForAllRecord(string first, string second, string third, string fourth,
     IPledgeResult expectedResult, int numberOfExpectedGoodRecords)
 {
     Reload(first, second, third, fourth);
     RunTest(expectedResult, numberOfExpectedGoodRecords);
 }
コード例 #4
0
ファイル: TestValidator.cs プロジェクト: tuvoksg1/RulesEngine
 private void RunTest(IPledgeResult expectedResult, int numberOfExpectedGoodRecords)
 {
     var numberOfBadRecords = FakeIngest.TotalRecords - numberOfExpectedGoodRecords;
     var result = _pipeline.Run(_token);
     Assert.AreEqual(expectedResult.FileHasInvalidRecords, result.PledgeResult.FileHasInvalidRecords, "The validator did not return the expected result");
     Assert.AreEqual(expectedResult.FileHasValidRecords, result.PledgeResult.FileHasValidRecords, "The validator did not return the expected result");
     Assert.AreEqual(expectedResult.TotalRecordsProcessed, result.PledgeResult.TotalRecordsProcessed, "Total records count are different");
     Assert.AreEqual(numberOfExpectedGoodRecords, result.PledgeResult.TotalPassedRecordsCount, "Total good records count are different");
     Assert.AreEqual(numberOfBadRecords, result.PledgeResult.TotalFailedRecordsCount, "Total bad records count are different");
 }
コード例 #5
0
ファイル: TestValidator.cs プロジェクト: tuvoksg1/RulesEngine
 private void RunTestForSingleRecord(int row, string first, string second, string third, string fourth,
     IPledgeResult expectedResult, int numberOfExpectedGoodRecords, bool hasHeader = false)
 {
     Reload(row, first, second, third, fourth, hasHeader);
     RunTest(expectedResult, numberOfExpectedGoodRecords);
 }