public async Task AddLandmarkNoName() { var locationService = CreateMockLocationService(); var imeiService = CreateMockIMEIService(); var controller = new MapController(locationService.Object, imeiService.Object, null); var res = await controller.AddLandmark(null, TestLatitude, TestLongitude); var view = res as HttpStatusCodeResult; Assert.NotNull(view); Assert.Equal(HttpStatusCode.BadRequest, (HttpStatusCode)view.StatusCode); }
public async Task AddLandmarkGoodData() { var locationService = CreateMockLocationService(); var imeiService = CreateMockIMEIService(); var controller = new MapController(locationService.Object, imeiService.Object, null); var res = await controller.AddLandmark(TestLandmark, TestLatitude, TestLongitude); locationService.Verify(l => l.RegisterLandmark(It.Is <string>(s => s == TestLandmark), It.Is <decimal>(s => s == TestLatitude), It.Is <decimal>(s => s == TestLongitude), null)); var view = res as HttpStatusCodeResult; Assert.NotNull(view); Assert.Equal(HttpStatusCode.Created, (HttpStatusCode)view.StatusCode); }