public void GetAll_DatabaseEmpty_True() { //Arrange, Act int result = Rock.GetAll().Count; //Assert Assert.Equal(0, result); }
public void Test_DeleteAll_ClearsDatabase() { Rock newRock = new Rock("sapphire", 1); newRock.Save(); Rock.DeleteAll(); int result = Rock.GetAll().Count; Assert.Equal(0, result); }
public void Save_SaveObjectToDB_True() { Rock newRock = new Rock("quartz", 3); List <Rock> expectedResult = new List <Rock> { newRock }; newRock.Save(); List <Rock> result = Rock.GetAll(); Assert.Equal(expectedResult, result); }
public HomeModule() { Get["/"] = _ => { return(View["index.cshtml"]); }; Post["/"] = _ => { Rock newRock = new Rock(Request.Form["name"], Request.Form["mass"]); newRock.Save(); List <Rock> allRocks = Rock.GetAll(); return(View["index.cshtml", allRocks]); }; }