public void WHEN_adding_two_throughputs_THEN_the_sum_of_both_is_returned( ThroughputPerDay a, ThroughputPerDay b, ThroughputPerDay expectedResult) { var actualSum = a + b; Assert.Equal(expectedResult, actualSum); }
public void WHEN_dividing_two_throughputs_THEN_the_result_is_as_expected( ThroughputPerDay numerator, double denominator, ThroughputPerDay expectedResult) { ThroughputPerDay actualResult = numerator / denominator; Assert.Equal(expectedResult, actualResult); }
public void WHEN_converting_to_string_with_IFormatProvider_THEN_string_is_as_expected( ThroughputPerDay throughput, string formatString, CultureInfo culture, string expectedString) { string actualString = throughput.ToString(formatString, culture); Assert.Equal(expectedString, actualString); }
public void GIVEN_one_input_metric_AND_one_project_WHEN_estimating_time_to_completion_THEN_return_number_of_work_days( ThroughputPerDay throughput, Project project, double expectedNumberOfDaysRequired) { var inputMetrics = ToInputMetrics(new[] { throughput }); var roadmap = new Roadmap(new[] { project }); var estimator = new TimeTillCompletionEstimator(inputMetrics, randomNumberGeneratorMock.Object, someMaximumNumberOfIterations); var estimations = estimator.Estimate(roadmap); Assert.Equal(2, estimations.Count); WorkEstimate roadmapWorkEstimate = estimations[0]; Assert.Equal("Roadmap", roadmapWorkEstimate.Identifier); AssertExpectedNumberOfWorkingDaysIsEqual(expectedNumberOfDaysRequired, roadmapWorkEstimate); AssertEstimateIsDeterminate(roadmapWorkEstimate); WorkEstimate projectWorkEstimate = estimations[1]; Assert.Equal("Project", projectWorkEstimate.Identifier); AssertExpectedNumberOfWorkingDaysIsEqual(expectedNumberOfDaysRequired, roadmapWorkEstimate); AssertEstimateIsDeterminate(roadmapWorkEstimate); }
public GIVEN_some_throughput_AND_another_throughput_with_the_same_value() { const double someThroughputValue = 5.0; someThroughput = new ThroughputPerDay(someThroughputValue); anotherThroughputWithSameValue = new ThroughputPerDay(someThroughputValue); anotherThroughputBoxedAsObject = anotherThroughputWithSameValue; }
public void WHEN_converting_to_string_THEN_string_is_as_expected( ThroughputPerDay throughput, string expectedString) { CultureInfo.DefaultThreadCurrentCulture = EnglishUsCultureInfo; string actualString = throughput.ToString(); Assert.Equal(expectedString, actualString); }
public GIVEN_some_throughput() { someThroughput = new ThroughputPerDay(4.0); originalDefaultThreadCulture = CultureInfo.DefaultThreadCurrentCulture; }
public void AND_default_constructor_is_used_THEN_it_has_a_value_of_zero() { ThroughputPerDay defaultConstructedThroughput = default; Assert.Equal(new ThroughputPerDay(0), defaultConstructedThroughput); }
private static void AssertThroughputEqualsReturnsFalse(ThroughputPerDay a, ThroughputPerDay b) => AssertThroughputEqualsReturnsExpectedValue(a, b, false);
private static void AssertThroughputEqualsReturnsFalseCommutatively(ThroughputPerDay a, ThroughputPerDay b) { AssertThroughputEqualsReturnsFalse(a, b); AssertThroughputEqualsReturnsFalse(b, a); }
static void Call() => _ = new ThroughputPerDay(double.PositiveInfinity) / double.PositiveInfinity;
public GIVEN_some_throughput_AND_another_throughput_with_a_different_value() { someThroughput = new ThroughputPerDay(5.0); anotherThroughputWithDifferentValue = new ThroughputPerDay(6.0); }