コード例 #1
0
        public async Task CreateObjectAsync_Success_CreatedObjectReturned(Dto dto)
        {
            //Act
            var actualResult = await section.InsertAsync(dto);

            await section.DeleteAsync(actualResult.Id); //Clear database

            dto.Id = actualResult.Id;

            var expectedResult = dto.ToExpectedObject();

            //Assert
            expectedResult.ShouldEqual(actualResult);
        }
コード例 #2
0
        public async Task UpdateObjectAsync_Success_UpdatedObjectReturned(Dto dto)
        {
            //Arrange
            var result = await section.InsertAsync(new Dto { Name = "TestAirlineEx1", Iata = "TSA1" });

            //Act
            var actualResult = await section.UpdateAsync(result.Id, dto);

            await section.DeleteAsync(actualResult.Id); //Clear database

            dto.Id = actualResult.Id;

            var expectedResult = dto.ToExpectedObject();

            //Assert
            expectedResult.ShouldEqual(actualResult);
        }