public void Should_GetSpentPerHour_Return_Default_Value_If_Consumables_Has_Zero_Values()
 {
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour("0 days"), 0);
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour("0 weeks"), 0);
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour("0 months"), 0);
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour("0 years"), 0);
     Assert.Pass("OK for Zero Values test");
 }
 public void Should_GetSpentPerHour_Return_Value_If_Consumables_Is_Pascal_Case_And_Singular()
 {
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("1 Hour") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("1 Day") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("1 Week") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("1 Month") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("1 Year") > 0);
     Assert.Pass("OK for PascalCase and Singular test");
 }
 public void Should_GetSpentPerHour_Return_Value_If_Consumables_Per_Year_IsPuzzledCase_and_Plural()
 {
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("2 hoUrs") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("2 DayS") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("2 weeKs") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("5 mOnths") > 0);
     Assert.IsTrue(StarshipBusiness.GetSpentPerHour("8 YeArs") > 0);
     Assert.Pass("OK GetSpentPerHour for PascalCase and Plural test");
 }
        public void Should_GetSpentPerHour_Return_Same_Value_For_Different_Time_Unit()
        {
            var hours = StarshipBusiness.GetSpentPerHour("8760 hours");
            var day   = StarshipBusiness.GetSpentPerHour("365 days");
            var year  = StarshipBusiness.GetSpentPerHour("1 year");

            Assert.IsTrue(hours == day && hours == year && day == year);

            Assert.Pass("OK GetSpentPerHour for return same value for different time unit test");
        }
        public void Should_GetSpentPerHour_Return_Default_Value_If_Consumables_Is_Negative()
        {
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 hours"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 days"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 weeks"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 months"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 years"), 0);

            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 hour"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 day"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 week"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 month"), 0);
            Assert.AreEqual(StarshipBusiness.GetSpentPerHour("-1 year"), 0);
            Assert.Pass("OK for Negative Values test");
        }
 public void Should_GetSpentPerHour_ReturnDefault_Value_If_Consumables_Is_Empty()
 {
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour(string.Empty), 0);
     Assert.Pass("OK for Empty Values test");
 }
 public void Should_GetSpentPerHour_Return_Default_Value_If_Consumables_Is_Null()
 {
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour(null), 0);
     Assert.Pass("OK for Null Values test");
 }
 public void Should_GetSpentPerHour_Return_Default_Value_If_Consumables_Has_Invalid_Values()
 {
     Assert.AreEqual(StarshipBusiness.GetSpentPerHour("invalid invalid"), 0);
     Assert.Pass("OK for Invalid Values test");
 }