public void When_Default_is_called_Then_Skipped_Total_and_Current_should_be_0() { // Act. var defaultCount = PagedEnumerableCount.Default(); // Assert. defaultCount.Skipped.Should().Be(0L); defaultCount.Total.Should().Be(0L); defaultCount.Current.Should().Be(0L); }
/// <summary> /// Initializes a new instance of the <see cref="PagedEnumerableMetadata"/> class /// using the given builder. /// </summary> /// <param name="builder">The builder to use.</param> private PagedEnumerableMetadata(PagedEnumerableMetadataBuilder builder) { if (builder is null) { throw new System.ArgumentNullException(nameof(builder)); } this.Count = builder.Count ?? PagedEnumerableCount.Default(); this.Navigation = builder.Navigation ?? PagedEnumerableNavigation.Default(); }
public void When_Default_is_called_Then_Count_and_Navigation_should_equal_respective_Default() { // Act. var defaultMetadata = PagedEnumerableMetadata.Default(); var defaultCount = PagedEnumerableCount.Default(); var defaultNavigation = PagedEnumerableNavigation.Default(); // Assert. defaultMetadata.Count.Should().BeEquivalentTo(defaultCount); defaultMetadata.Navigation.Should().BeEquivalentTo(defaultNavigation); }
public void Given_no_inputs_When_Create_is_called_Then_instance_will_have_Default_members() { // Arrange. var defaultCount = PagedEnumerableCount.Default(); var defaultNavigation = PagedEnumerableNavigation.Default(); PagedEnumerableMetadata metadata; // Act. metadata = PagedEnumerableMetadataBuilder.Create() .Build(); // Assert. metadata.Count.Should().BeEquivalentTo(defaultCount); metadata.Navigation.Should().BeEquivalentTo(defaultNavigation); }