示例#1
0
        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);
        }
示例#2
0
 /// <summary>
 /// Overload constructor with parameters.
 /// </summary>
 public CompactionCmvPercentChangeResult(CMVChangeSummaryResult result)
 {
     if (result != null && result.HasData())
     {
         SummaryData = new CmvChangeSummaryData
         {
             Percents = result.Values,
             TotalAreaCoveredSqMeters = result.CoverageArea
         };
     }
 }
示例#3
0
        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);
        }
示例#4
0
        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());
        }