Beispiel #1
0
        public async Task ThenTheOrderDescriptionForOrderWithIdIsSetTo(string orderId, Table table)
        {
            var expected = table.CreateInstance<OrderDescriptionTable>().Description;

            var actual = (await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId)).Description;
            actual.Should().BeEquivalentTo(expected);
        }
Beispiel #2
0
        public async Task ThenTheOrderDescriptionForOrderWithIdIsSetToToday(string orderId)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            actual.CommencementDate.HasValue.Should().BeTrue();
            actual.CommencementDate.Value.Date.Should().Be(DateTime.Today.Date);
        }
Beispiel #3
0
        public async Task ThenTheOrderDescriptionForOrderWithIdIsSetToDaysInTheFuture(string orderId, int days)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            actual.CommencementDate.HasValue.Should().BeTrue();
            actual.CommencementDate.Value.Date.Should().Be(DateTime.Today.Date + TimeSpan.FromDays(days));
        }
Beispiel #4
0
        public async Task ThenTheOrderStatusIsSetCorrectly()
        {
            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, updateOrderStatusRequest.OrderId);

            var orderStatus = Enum.Parse <OrderStatus>(updateOrderStatusRequest.Payload.Status);

            order.OrderStatus.Should().Be(orderStatus);
        }
Beispiel #5
0
        public async Task ThenTheOrderWithOrderIdHasOrganisationAddresData(string orderId, Table table)
        {
            var order = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            var actual = await AddressEntity.FetchAddressById(_settings.ConnectionString, order.OrganisationAddressId);

            table.CompareToInstance <AddressEntity>(actual);
        }
Beispiel #6
0
        public async Task ThenTheSupplierForOrderIsUpdated(string orderId, Table table)
        {
            var supplier = table.CreateInstance <SupplierSectionTable>();

            var order = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            var actual = new { order.SupplierId, order.SupplierName };

            actual.Should().BeEquivalentTo(supplier);
        }
        public async Task ThenTheOrderWithOrderIdHasContactData(int orderId, Table table)
        {
            var expected = table.CreateInstance <ContactEntity>();

            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, orderId);

            var actual = await ContactEntity.FetchContactById(settings.ConnectionString, order.OrderingPartyContactId);

            actual.Should().BeEquivalentTo(expected, options => options.Excluding(c => c.Id));
        }
Beispiel #8
0
        public async Task ThenTheOrderWithOrderIdHasContactData(string orderId, Table table)
        {
            var expected = table.CreateInstance <ContactEntity>();

            var order = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            var actual = await ContactEntity.FetchContactById(_settings.ConnectionString, order.OrganisationContactId);

            actual.Should().BeEquivalentTo(expected);
        }
Beispiel #9
0
        public async Task ThenTheSupplierAddressForOrderIs(string orderId, Table table)
        {
            var address = table.CreateInstance <SupplierAddressTable>();

            var addressId = (int)(await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId))
                            .SupplierAddressId;

            var actual = await AddressEntity.FetchAddressById(_settings.ConnectionString, addressId);

            actual.Should().BeEquivalentTo(address);
        }
Beispiel #10
0
        public async Task ThenTheSupplierContactIdContactForOrderIs(string orderId, Table table)
        {
            var contact = table.CreateInstance <SupplierContactTable>();

            var contactId = (int)(await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId))
                            .SupplierContactId;

            var actual = await ContactEntity.FetchContactById(_settings.ConnectionString, contactId);

            actual.Should().BeEquivalentTo(contact);
        }
Beispiel #11
0
        public async Task ThenTheOrderCompletedDateIsSet()
        {
            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, updateOrderStatusRequest.OrderId);

            order.Completed.Should().NotBeNull();
        }
Beispiel #12
0
        public async Task ThenTheOrderIsCreatedInTheDatabase(string orderId, Table table)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            table.CompareToInstance(actual);
        }
        public async Task ThenTheExpectedOrderIsDeleted()
        {
            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, deleteOrderRequest.OrderId);

            order.IsDeleted.Should().BeTrue();
        }
Beispiel #14
0
        public async Task TheOrderWithIdHasCatalogueSolutionsViewedSet(string orderId, bool viewed)
        {
            var actual = (await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId)).CatalogueSolutionsViewed;

            actual.Should().Be(viewed);
        }
        public async Task ThenTheOrderHasAPrimaryContact(int orderId)
        {
            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, orderId);

            order.OrderingPartyContactId.Should().NotBeNull();
        }
        public async Task ThenOrderWithOrderIdHasRevision(int orderId, byte revision)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, orderId);

            actual.Revision.Should().Be(revision);
        }
        public async Task ThenTheOrderDescriptionForOrderWithIdIsSetToDaysAgo(int orderId, int days)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, orderId);

            actual.CommencementDate?.Date.Should().Be(DateTime.Today.Date - TimeSpan.FromDays(days));
        }
Beispiel #18
0
        public async Task ThenOrderOrderIdHasCreatedAtCurrentTime(string orderId)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            actual.Created.Should().BeWithin(TimeSpan.FromSeconds(3)).Before(DateTime.UtcNow);
        }
        public async Task ThenTheExpectedCatalogueSolutionOrderItemIsCreated()
        {
            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, fundingSourceRequest.OrderId);

            order.FundingSourceOnlyGms.Should().Be(fundingSourceRequest.Payload.OnlyGms);
        }
Beispiel #20
0
        public async Task ThenTheOrderDoesNotHaveAPrimaryContact(string orderId)
        {
            var order = await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId);

            order.OrganisationContactId.Should().BeNull();
        }
        public async Task ThenOrderWithOrderIdHasCallOffId(int orderId, string callOffId)
        {
            var actual = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, orderId);

            actual.CallOffId.Should().Be(callOffId);
        }
Beispiel #22
0
 public async Task ThenTheLastUpdatedNameIsUpdatedInTheDatabase(string expected, string orderId)
 {
     var actual = (await OrderEntity.FetchOrderByOrderId(_settings.ConnectionString, orderId)).LastUpdatedByName;
     actual.Should().BeEquivalentTo(expected);
 }
        public async Task ThenTheFundingSourceOnlyGmsIs()
        {
            var order = await OrderEntity.FetchOrderByOrderId(settings.ConnectionString, deleteOrderItemRequest.OrderId);

            order.FundingSourceOnlyGms.Should().BeNull();
        }