public void CalculatePercentWear_Writeoff_WearPercentTest_50Percent()
        {
            var issue = new EmployeeIssueOperation();

            issue.StartOfUse   = new DateTime(2018, 1, 31);
            issue.ExpiryByNorm = new DateTime(2018, 2, 10);

            var atDate = new DateTime(2018, 2, 5);
            var result = issue.CalculatePercentWear(atDate);

            Assert.That(result, Is.EqualTo(0.5m));
        }
        public void CalculatePercentWear_Writeoff_WearPercentTest_StartPercentPlus10()
        {
            var issue = new EmployeeIssueOperation();

            issue.WearPercent  = 0.45m;
            issue.StartOfUse   = new DateTime(2018, 1, 1);
            issue.ExpiryByNorm = new DateTime(2018, 1, 11);

            var atDate = new DateTime(2018, 1, 2);
            var result = issue.CalculatePercentWear(atDate);

            Assert.That(result, Is.EqualTo(0.55m));
        }
        public void CalculatePercentWear_InfinityWhenDecimalConvert()
        {
            var result = EmployeeIssueOperation.CalculatePercentWear(new DateTime(2019, 8, 2), new DateTime(2019, 7, 17), new DateTime(2019, 7, 17), 0);

            Assert.That(result, Is.EqualTo(0));
        }
 public void CalculatePercentWear_NotOverflowExceptionForDecimalConvert()
 {
     var result = EmployeeIssueOperation.CalculatePercentWear(new DateTime(2019, 1, 1), new DateTime(2019, 1, 1), new DateTime(2019, 1, 1), 0);
 }