public void Client_Find() { Client newClient = new Client("Dave", 2); newClient.Save(); Client testClient = Client.Find(newClient.GetId()); Console.WriteLine("Find: " + newClient.GetId() + " " + testClient.GetId()); Assert.Equal(testClient, newClient); }
public void Client_IdPassesCorrectly() { Client testClient = new Client("Dave", 1); int result = testClient.GetId(); Assert.Equal(0, result); }
public void Test3_FindCorrectClient() { Client testClient = new Client("ClientName", 1); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public void Test_Find_FindsClientInDatabase() { Client testClient = new Client("Pesron1", 1, "email"); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public void Test5_Find_FindClientInDatabase() { Client testClient = new Client("Robert",1); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public void Test_Find_FindsClientInDatabase() { Client testClient = new Client("Susan", "Portland", 1); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public HomeModule() { Get["/"] = _ => { Dictionary <string, object> model = new Dictionary <string, object> { { "clients", Client.GetAll() }, { "stylists", Stylist.GetAll() } }; return(View["index.cshtml", model]); }; Get["/clients"] = _ => { Dictionary <string, object> model = new Dictionary <string, object> { { "clients", Client.GetAll() }, { "stylists", Stylist.GetAll() } }; return(View["clients.cshtml", model]); }; Get["/stylists"] = _ => { Dictionary <string, object> model = new Dictionary <string, object> { { "clients", Client.GetAll() }, { "stylists", Stylist.GetAll() } }; return(View["stylists.cshtml", model]); }; Get["/clients/edit/{id}"] = parameters => { Client foundClient = Client.Find(parameters.id); return(View["client-edit.cshtml", foundClient]); }; Get["/clients/view/{id}"] = parameters => { Client foundClient = Client.Find(parameters.id); return(View["client-details.cshtml", foundClient]); }; Get["/stylists/view/{id}"] = parameters => { Stylist foundStylist = Stylist.Find(parameters.id); return(View["stylist-details.cshtml", foundStylist]); }; Post["/clients/new"] = _ => { int newStylistId = Request.Form["stylist-id"]; Client newClient = new Client(Request.Form["client-name"], newStylistId); newClient.Save(); return(View["client-details.cshtml", newClient]); }; Post["/stylists/new"] = _ => { Stylist newStylist = new Stylist(Request.Form["stylist-name"]); newStylist.Save(); return(View["stylist-details.cshtml", newStylist]); }; Patch["clients/edit/{id}"] = parameters => { Client foundClient = Client.Find(parameters.id); foundClient.Update(Request.Form["client-name"]); return(View["client-details.cshtml", foundClient]); }; Delete["clients/delete/{id}"] = parameters => { Dictionary <string, object> model = new Dictionary <string, object> { { "clients", Client.GetAll() }, { "stylists", Stylist.GetAll() } }; Client foundClient = Client.Find(parameters.id); Client.Delete(foundClient.GetId()); return(View["index.cshtml", model]); }; }
public void Test_FindClientInDatabase() { Client testClient = new Client("Chet", 2); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public void Test_Find_FindsClientInDatabase() { Client testClient = new Client("Susie", 1, "Monday", "11:30"); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public void Test_Find_FindsClientInDatabase() { Client testClient = new Client("Mako", "Tips well, comes in once a week.", 1); testClient.Save(); Client foundClient = Client.Find(testClient.GetId()); Assert.Equal(testClient, foundClient); }
public void Test_IfCanFindByID_True() { Client newClient = new Client("Joe Klein", 1); Client foundClient = new Client("Joe Klein", 1); newClient.Save(); newClient = Client.FindById(newClient.GetId()); Assert.Equal(foundClient, newClient); }
public void Test_Save_AssignsIdToObject() { Client testClient = new Client("Person1", 1, "email"); testClient.Save(); Client savedClient = Client.GetAll()[0]; int result = savedClient.GetId(); int testId = testClient.GetId(); Assert.Equal(testId, result); }
public void Test2_Save() { Client testClient = new Client("ClientName", 1); testClient.Save(); Client savedClient = Client.GetAll()[0]; int result = savedClient.GetId(); int testId = testClient.GetId(); Assert.Equal(testId, result); }
public void Test_Save_AssignsIdToObject() { Client testClient = new Client("Susie", 1, "Monday", "11:30"); testClient.Save(); Client savedClient = Client.GetAll()[0]; int result = savedClient.GetId(); int testId = testClient.GetId(); Assert.Equal(testId, result); }
public void Test_FindClient() { //Arrange Client search = new Client("Jimmy the Client", 1); //Act search.Save(); Client found = Client.Find(search.GetId()); //Assert Assert.Equal(search, found); }
public void TestClient_Find_ClientInDatabase() { Stylist newStylist = new Stylist("Jessica", 5); newStylist.Save(); Client newClient = new Client("Tom", newStylist.GetId()); newClient.Save(); Client foundClient = Client.Find(newClient.GetId()); Assert.Equal(newClient, foundClient); }
public void Test_Find_ClientInDatabase() { //Arrange Client testClient = new Client("Summer Smith", "785-267-7865", "*****@*****.**", 1); testClient.Save(); //Act Client foundClient = Client.Find(testClient.GetId()); //Assert Assert.Equal(testClient, foundClient); }
public void Test_Find_FindsClientInDatabase() { //Arrange Client testClient = new Client("Vin Diesel", 3); testClient.Save(); //Act Client foundClient = Client.Find(testClient.GetId()); //Assert Assert.Equal(testClient, foundClient); }
public void Test3_Save_AssignsIdToObject() { Client testClient = new Client("Alex",1); testClient.Save(); Client savedClient = Client.GetAll()[0]; int result = savedClient.GetId(); int testId = testClient.GetId(); Assert.Equal(testId, result); }
public void Find_FindsClientById_true() { //Arrange Client newClient = new Client("Betty", 2); newClient.Save(); //Act Client foundClient = Client.Find(newClient.GetId()); //Assert Assert.Equal(newClient, foundClient); }
public void Test_Save_AssignsIdToObject() { Client testClient = new Client("Susan", "Portland", 1); testClient.Save(); Client savedClient = Client.GetAll()[0]; int result = savedClient.GetId(); int testId = testClient.GetId(); Assert.Equal(testId, result); }
public void TestClients_Find_FindsClientInDatabase() { //arrange Client newClient = new Client("Amber", 1); newClient.Save(); //Act Client foundClient = Client.Find(newClient.GetId()); //assert Assert.Equal(newClient, foundClient); }
public void Test_Save_AssignsIdToClientObject() { Client testClient = new Client("Mako", "Tips well, comes in once a week.", 1); testClient.Save(); Client savedClient = Client.GetAll()[0]; int testId = testClient.GetId(); int result = savedClient.GetId(); Assert.Equal(testId, result); }
public void T5_Find_DoesFindWork() { //Arrange Client testClient = new Client("Joe Lee", 1); testClient.Save(); //Act Client foundClient = Client.Find(testClient.GetId()); //Assert Assert.Equal(testClient, foundClient); }
public void Find_FindsClientInDatabase_specifiedClient() { //Arrange Client testClient = new Client("Veronique Moore", 2); testClient.Save(); //Act Client foundClient = Client.Find(testClient.GetId()); //Assert Assert.Equal(testClient, foundClient); }
public void Test_UpdateString_ReturnsTrueIfClientInfoIsTheSame() { //Arrange Client firstTestClient = new Client("Vin Diesel", 3); firstTestClient.Save(); Client secondTestClient = new Client("Dwayne Johnson", 3, firstTestClient.GetId()); //Act secondTestClient.UpdateString("Vin Diesel"); //Assert Assert.Equal(firstTestClient, secondTestClient); }
public void Edit_UpdatesValues_true() { //Arrange Client newClient = new Client("client1", 2); newClient.Save(); //Act newClient.Edit("Cliff", 1); Client foundClient = Client.Find(newClient.GetId()); Client expectedResult = new Client(newClient.GetName(), newClient.GetStylistId(), newClient.GetId()); //Assert Assert.Equal(expectedResult, foundClient); }
public void Test_Save_AssignsIdToClientInDatabase() { //Arrange Client testClient = new Client("Vin Diesel", 3); testClient.Save(); //Act Client savedClient = Client.GetAll()[0]; int testId = testClient.GetId(); int expectedId = savedClient.GetId(); //Assert Assert.Equal(testId, expectedId); }
public void Test_ObjectFoundInDatabase_True() { Console.WriteLine("Client Test: Object Found In db"); //Arrange Client testClient = new Client("Jordan Loop", 1); testClient.Save(); //Act Client foundClient = Client.Find(testClient.GetId()); //Assert Assert.Equal(testClient, foundClient); }
public override bool Equals(System.Object otherClient) { if (!(otherClient is Client)) { return(false); } else { Client newClient = (Client)otherClient; bool idEquality = (this.GetId() == newClient.GetId()); bool nameEquality = (this.GetName() == newClient.GetName()); bool stylistEquality = (this.GetStylistId() == newClient.GetStylistId()); return(idEquality && nameEquality && stylistEquality); } }
public void Test_FindClientFromStylist() { Stylist newStylist = new Stylist("Hilary", 1); newStylist.Save(); Client controlClient = new Client("David", 1); controlClient.Save(); Client newClient = Client.Find(controlClient.GetId()); Console.WriteLine(newClient.GetName()); Assert.Equal(controlClient.GetName(), newClient.GetName()); }
public void Test_ChangeNameOfClient() { Client newClient = new Client("Hunter", 10); newClient.Save(); Client testClient = Client.Find(newClient.GetId()); testClient.Save(); string newName = "Patrick"; testClient.Update(newName); Assert.Equal(newName, testClient.GetName()); }