public void CreateCmvPercentChangeResult_Should_return_null_object_When_CoverageArea_is_null() { var changeSummaryResult = new CMVChangeSummaryResult(null, 0); var result = new CompactionCmvPercentChangeResult(changeSummaryResult); Assert.IsNotNull(result); Assert.AreEqual(ContractExecutionResult.DefaultMessage, result.Message); Assert.IsNull(result.SummaryData); }
/// <summary> /// Overload constructor with parameters. /// </summary> public CompactionCmvPercentChangeResult(CMVChangeSummaryResult result) { if (result != null && result.HasData()) { SummaryData = new CmvChangeSummaryData { Percents = result.Values, TotalAreaCoveredSqMeters = result.CoverageArea }; } }
public void CreateCmvPercentChangeResult_Should_return_full_object_When_CoverageArea_is_not_null() { var changeSummaryResult = new CMVChangeSummaryResult(new[] { 3.4, 5.6 }, 34534); var result = new CompactionCmvPercentChangeResult(changeSummaryResult); Assert.IsNotNull(result); Assert.AreEqual(ContractExecutionResult.DefaultMessage, result.Message); Assert.AreEqual(34534, result.SummaryData.TotalAreaCoveredSqMeters); Assert.IsNotNull(result.SummaryData.Percents); }
public void HasData_Should_return_expected_result_From_coverage_value(double coverageArea, bool expectedResult) { var obj = new CMVChangeSummaryResult(null, coverageArea); Assert.AreEqual(expectedResult, obj.HasData()); }