Ejemplo n.º 1
0
        public async Task Can_Get_SystemRelations_AssociatedWithContract()
        {
            //Arrange
            var input = await PrepareFullRelationAsync(true, false, false);

            //Act
            using (var response = await SystemRelationHelper.SendPostRelationRequestAsync(input))
            {
                //Assert
                Assert.Equal(HttpStatusCode.Created, response.StatusCode);
                var relationsToContract          = (await SystemRelationHelper.GetRelationsAssociatedWithContractAsync(input.ContractId.GetValueOrDefault(-1))).ToList();
                var originalRelations            = (await SystemRelationHelper.GetRelationsFromAsync(input.FromUsageId)).ToList();
                var relationFromContractResponse = Assert.Single(relationsToContract);
                var relationFromOriginalResponse = Assert.Single(originalRelations);

                relationFromContractResponse.ToExpectedObject().ShouldMatch(relationFromOriginalResponse); //Same relation should yield same data at the dto level
            }
        }