Пример #1
0
        public void DeleteCollateral_Success()
        {
            // Act
            var response = controller.DeleteCollateral(defaultDeleteParentContactId, defaultDeleteContactId, DateTime.UtcNow);

            // Assert
            Assert.IsTrue(response.RowAffected > 0, "Collateral could not be deleted.");
        }
Пример #2
0
        public void DeleteCollateral_Success()
        {
            // Arrange
            PrepareResponse(colleteralDataForSuccess);

            collateralResponse.RowAffected = 1;

            mock.Setup(r => r.DeleteCollateral(It.IsAny <long>(), It.IsAny <long>(), DateTime.UtcNow))
            .Callback((long id) => collaterals.Remove(collaterals.Find(collateralContact => collateralContact.ContactID == id)))
            .Returns(collateralResponse);

            //Act
            var deleteCollateralResult = collateralController.DeleteCollateral(defaultDeleteParentContactId, defaultDeleteContactId, DateTime.UtcNow);
            var response = deleteCollateralResult as HttpResult <Response <CollateralModel> >;

            //Assert
            Assert.IsNotNull(response, "Response can't be null");
            Assert.IsTrue(response.Value.ResultCode == 0, "Collateral could not be deleted.");
            Assert.IsTrue(response.Value.RowAffected > 0, "Collateral could not be deleted.");
        }