public void Should_Get_All_Hotspots() { //Arrange var hotspot = new HotSpotService(); //Act var sut = hotspot.GetAll(); //Assert sut.Count.Should().BeGreaterOrEqualTo(1); }
public void Should_Add_Hotspot() { //Arrange HotSpotService hs = new HotSpotService(); HotSpotModel hotspot = new HotSpotModel() { LocationName = "Burzyńskiego 12", LatitudeX = "54", LongitudeY = "18", }; //Act var sut = hs.AddHotSpot(hotspot); var lastHotSpot = hs.GetAll().TakeLast(1); //Assert Assert.Collection(lastHotSpot, item => Assert.Contains("Burzyńskiego", item.LocationName)); Assert.Collection(lastHotSpot, item => Assert.Contains("54", item.LatitudeX)); Assert.Collection(lastHotSpot, item => Assert.Contains("18", item.LongitudeY)); }
public void Should_Update_Old_Data_In_Hotspot() { //Arrange var hotspotService = new HotSpotService(); var allHotSpots = hotspotService.GetAll(); var updatedHotSpot = new HotSpotModel() { LocationName = "testing", LatitudeX = "111", LongitudeY = "222", //Number pop and FakeId prop are not taking care into consideration for the update purpose //Therefore it's values will be the same as used to be Number = 1, fakeID = "LOK001" }; var currentHotSpot = hotspotService.GetById(1); //Act hotspotService.Update(1, updatedHotSpot); //Assert currentHotSpot.Should().BeEquivalentTo(updatedHotSpot); }