public void AddComplaint_ReturnErrorMessage_WhenNullClient() { Client c = null; var CM = new ComplaintManagement(); var result = CM.AddComplaint(c, exampleTopic, exmapleBody, exmapleFormOfCompensation); Assert.AreEqual("Client required", result); }
public void AddComplaint_ReturnErrorMessage_WhenEmptyTopic() { var c = MakeStubClient(); var CM = new ComplaintManagement(); var result = CM.AddComplaint(c, "", exmapleBody, exmapleFormOfCompensation); Assert.AreEqual("Topic and Body required", result); }
public void AddNewClientAndFind_ReturnClient_WhenExist() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); Assert.IsNotNull(CM.FindClient(exmapleName, exmapleSurname, exmapleNumber)); }
public void AddClient_ReturnFlase_WhenClienExist() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); Assert.IsFalse(CM.NewClient(exmapleName, exmapleSurname, exmapleNumber)); }
public void AddNewClient_Return1_WhenIsAddOneClient() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); Assert.AreEqual(CM.Clients.Count, 1); }
async public Task <IHttpActionResult> AddNew(ComplaintManagement complaintManagement) { Db.ComplaintManagements.Add(complaintManagement); await Db.SaveChangesAsync(); var ComId = (await Db.ComplaintManagements.FirstOrDefaultAsync(e => e.ProjectId == complaintManagement.ProjectId && e.ComplaintDate == complaintManagement.ComplaintDate && e.ComplaintEntertainedDate == complaintManagement.ComplaintEntertainedDate)).Id; return(Ok(ComId)); }
public void AddComplaint_ReturnSuccessMessage_WhenCorrect() { var CM = new ComplaintManagement(); var c = MakeStubClient(); var result = CM.AddComplaint(c, exampleTopic, exmapleBody, exmapleFormOfCompensation); StringAssert.Equals("Added Succesfully", result); }
public void DropClientStrings_ReturnFalase_WhenClientNotExist() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); var result = CM.DropClient(exmapleName, exmapleSurname, "588214521"); Assert.IsFalse(result); }
public void AddComplaintObjects_ReturnTopic_WhenAdded() { var c = MakeStubClient(); var complaint = MakeStubComplaint(); var CM = new ComplaintManagement(); var result = CM.AddComplaint(c, complaint); Assert.AreEqual(exampleTopic, CM.Complaints[0].Topic); }
public void AddComplaintObjects_ReturnSuccessMessage_WhenObjectIsCorrect() { var c = MakeStubClient(); var complaint = MakeStubComplaint(); var CM = new ComplaintManagement(); var result = CM.AddComplaint(c, complaint); Assert.AreEqual("Added Succesfully", result); }
public void DropClient_ReturnFalase_WhenOneValueIsNull() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); var result = CM.DropClient(exmapleName, exmapleSurname, null); Assert.IsFalse(result); }
public void DropUClientWithStrings_ReturnTrue_WhenStringsIsCorrect() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); var result = CM.DropClient(exmapleName, exmapleSurname, exmapleNumber); Assert.IsTrue(result); }
public void DropClient_ReturnFalse_ObjectNull() { var CM = new ComplaintManagement(); Client c = null; CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); var result = CM.DropClient(c); Assert.IsFalse(result); }
public void DropClient_ReturnFalse_WhenOneValueIsDiferent() { var CM = new ComplaintManagement(); var c = MakeStubClient(); CM.NewClient(exmapleName, exmapleSurname, "513888789"); var result = CM.DropClient(c); Assert.IsFalse(result); }
public void DropClient_RetrunTrue_WhenClientExist() { var CM = new ComplaintManagement(); var c = MakeStubClient(); CM.NewClient(exmapleName, exmapleSurname, exmapleNumber); var result = CM.DropClient(c); Assert.IsTrue(result); }
public void AddThreeClients_ReturnListClients_CheckifFourtContains_ExpectedNot() { var CM = new ComplaintManagement(); for (int i = 0; i < 3; i++) { CM.Clients.Add(MakeStubClient(i.ToString(), exmapleSurname, exmapleNumber)); } var notAdded = MakeStubClient(exmapleName, exmapleSurname, exmapleNumber); CollectionAssert.DoesNotContain(CM.Clients, notAdded); }
public void AddThreeClients_ReturnCount4_WhenAllIsAdded() { var CM = new ComplaintManagement(); IClient[] cc = new StubIClient[4]; for (int i = 0; i < 4; i++) { cc[i] = MakeStubClient(i.ToString(), exmapleSurname, exmapleNumber); CM.Clients.Add(cc[i]); } Assert.AreEqual(CM.Clients.Count, 4); }
public void AddThreeClients_ReturnListClients_WhenAllAddSuccessfully() { var CM = new ComplaintManagement(); IClient[] cc = new StubIClient[3]; for (int i = 0; i < 3; i++) { cc[i] = MakeStubClient(i.ToString(), exmapleSurname, exmapleNumber); CM.Clients.Add(cc[i]); } CollectionAssert.Contains(CM.Clients, cc[1]); }
public void AddClient_RetrunExceptions_WhenSomeValueIsNull() { var CM = new ComplaintManagement(); CM.NewClient(exmapleName, null, exmapleNumber); }
public void FindClient_ReturnNull_WhenEmptyListClients() { var CM = new ComplaintManagement(); Assert.IsNull(CM.FindClient(exmapleName, exmapleSurname, exmapleNumber)); }
public void MakeNewObjectComplaintManagement_Return0_WhenListComplaintsIsEmpty() { var CM = new ComplaintManagement(); Assert.AreEqual(0, CM.Complaints.Count); }