public void addInvalidClientAction() { //Arrange DataBaseContext db = new DataBaseContext(); IClientActionRepository clientActionRepo = new ClientActionRepository(db); Guid clientID = new Guid(); string action = "Search"; ClientAction ca = new ClientAction(clientID, action); //Act => Assert Assert.ThrowsException <DbUpdateException>(() => clientActionRepo.AddClientAction(ca)); }
public void addValidClientAction() { //Arrange DataBaseContext db = new DataBaseContext(); IClientActionRepository clientActionRepo = new ClientActionRepository(db); Guid clientID = new Guid("6DF91B37-DC4A-E911-8259-0A64F53465D0"); string action = "Search"; ClientAction ca = new ClientAction(clientID, action); //Act clientActionRepo.AddClientAction(ca); ClientAction addedCA = clientActionRepo.GetClientAction(clientID, action); //Assert Assert.IsNotNull(addedCA); }
public void ClientRepository_AddClientAction_ValidClientAction() { //Arrange DataBaseContext db = new DataBaseContext(); IClientActionRepository clientActionRepo = new ClientActionRepository(db); Guid clientID = new Guid("41361F37-036B-E911-AA03-021598E9EC9E"); string action = "Search"; ClientAction ca = new ClientAction(clientID, action); //Act clientActionRepo.AddClientAction(ca); ClientAction addedCA = clientActionRepo.GetClientAction(clientID, action); //Assert Assert.IsNotNull(addedCA); }