public void DeleteGateway() { //Arrange int gatewayId = 1; //Act var gateway = repositry.DeleteGateway(gatewayId); //Assert Assert.True(gateway); }
public async Task <bool> DeleteGateway(int gatewayId) { if (gatewayId != 0) { IEnumerable <Device> device = await Task.Run(() => _gatewayRepository.GetDevices(gatewayId)); if (device.Count() > 0) { return(false); } else { return(await Task.Run(() => _gatewayRepository.DeleteGateway(gatewayId))); } } else { return(false); } }