public async void Delete() { var mock = new ServiceMockFacade <IDeploymentRelatedMachineRepository>(); var model = new ApiDeploymentRelatedMachineRequestModel(); mock.RepositoryMock.Setup(x => x.Delete(It.IsAny <int>())).Returns(Task.CompletedTask); var service = new DeploymentRelatedMachineService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.DeploymentRelatedMachineModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLDeploymentRelatedMachineMapperMock, mock.DALMapperMockFactory.DALDeploymentRelatedMachineMapperMock); ActionResponse response = await service.Delete(default(int)); response.Should().NotBeNull(); mock.RepositoryMock.Verify(x => x.Delete(It.IsAny <int>())); mock.ModelValidatorMockFactory.DeploymentRelatedMachineModelValidatorMock.Verify(x => x.ValidateDeleteAsync(It.IsAny <int>())); }