public void Delete_N_WithNonExistingConfigId_ThrowsException() { // Arrange var configToDelete = new TestNetworkConfiguration() { Id = 123 }; // Act _service.Delete(configToDelete); }
public void Update_WithNonExistingConfig_ThrowsException() { // Arrange var configToUpdate = new TestNetworkConfiguration() { Id = 123 }; // Act _service.Update(configToUpdate); }
public void Delete_N_AfterDisposed_ThrowsException() { // Arrange var configToDelete = new TestNetworkConfiguration() { Id = 123 }; _service.Dispose(); // Act _service.Delete(configToDelete); }
public void Add_NetworkConfiguration_AfterDisposed_ThrowsException() { // Arrange var configToAdd = new TestNetworkConfiguration() { Id = 123 }; _service.Dispose(); // Act _service.Add(configToAdd); }
public void GetConfigurations_WithValidRepository_ReturnsConfigurations() { // Arrange var configToAdd = new TestNetworkConfiguration(999); _repository.Add(configToAdd); // Act var networkConfigs = _service.GetConfigurations(); // Assert Assert.IsNotNull(networkConfigs); Assert.IsTrue(networkConfigs.Count() == 1); }
public void Add_NetworkConfiguration_WithValidNetworkConfiguration_AddsNetworkConfigurationToRepository() { // Arrange var configToAdd = new TestNetworkConfiguration() { Id = 123 }; // Act _service.Add(configToAdd); var addedConfiguration = _service.FindConfiguration(configToAdd.Id); // Assert Assert.IsTrue(addedConfiguration == configToAdd); }
public void FindConfiguration_WithInvalidId_ReturnsNull() { // Arrange var configToAdd = new TestNetworkConfiguration() { Id = 123 }; _repository.Add(configToAdd); // Act var networkConfig = _service.FindConfiguration(234); // Assert Assert.IsNull(networkConfig); }
public void Update_WithExistingValidConfig_UpdatesConfigInRepository() { // Arrange var configToUpdate = new TestNetworkConfiguration() { Id = 123 }; _service.Add(configToUpdate); // Act configToUpdate.Id = 234; _service.Update(configToUpdate); // Assert Assert.IsTrue(configToUpdate.Id == 234); }
public void Delete_N_WithValidConfigId_DeletesConfigInRepository() { // Arrange var configToDelete = new TestNetworkConfiguration() { Id = 123 }; _service.Add(configToDelete); // Act _service.Delete(configToDelete); var deletedConfig = _service.FindConfiguration(configToDelete.Id); // Assert Assert.IsNull(deletedConfig); }
public void FindConfiguration_WithValidId_ReturnsNetworkConfiguration() { // Arrange var id = 123; var configToAdd = new TestNetworkConfiguration() { Id = id }; _repository.Add(configToAdd); // Act var networkConfig = _service.FindConfiguration(id); // Assert Assert.IsNotNull(networkConfig); Assert.IsTrue(networkConfig == configToAdd); }