Beispiel #1
0
        public void WithPagination_Should_Set_Pagination(FakeParameters parameters, OrderParameter <string> order, PaginationParameter pagination)
        {
            // Arrange
            var builder = new TestedBuilder();

            // Act
            var result = builder.Begin()
                         .WithParameters(parameters)
                         .WithOrder(order)
                         .WithPagination(pagination)
                         .Build();

            // Assert
            Check.That(result.Parameters.HasValue)
            .IsTrue();
            Check.That(result.Parameters.Value)
            .IsEqualTo(parameters);

            Check.That(result.Order.HasValue)
            .IsTrue();
            Check.That(result.Order.Value)
            .IsEqualTo(order);

            Check.That(result.Pagination.HasValue)
            .IsTrue();
            Check.That(result.Pagination.Value)
            .IsEqualTo(pagination);
        }
Beispiel #2
0
        private static void Assert_Throw_InvalidOperationException <TResult>(Func <TestedBuilder, TResult> build)
        {
            // Arrange
            var builder = new TestedBuilder();

            // Act
            var exception = Record.Exception(() => build(builder));

            // Assert
            Check.That(exception)
            .IsNotNull()
            .And.IsInstanceOf <InvalidOperationException>();
        }
Beispiel #3
0
        public void WithParameters_Should_Set_Parameters(FakeParameters parameters)
        {
            // Arrange
            var builder = new TestedBuilder();

            // Act
            var result = builder.Begin()
                         .WithParameters(parameters)
                         .Build();

            // Assert
            Check.That(result.Parameters.HasValue)
            .IsTrue();
            Check.That(result.Parameters.Value)
            .IsEqualTo(parameters);

            Check.That(result.Order.HasValue)
            .IsFalse();
            Check.That(result.Pagination.HasValue)
            .IsFalse();
        }