public void ConstructorInalizedCorectly_NewInstanceOfEditVenuesPresenterCreated()
        {
            var mockedview     = new Mock <IEditVenuesView>();
            var mockService    = new Mock <IVenueService>();
            var actualInstance = new EditVenuesPresenter(mockedview.Object, mockService.Object);

            Assert.That(actualInstance, Is.InstanceOf <EditVenuesPresenter>());
        }
        public void View_QueryEventSholdCallVenueServiceFilterVenuesWithCorrectLocationFilter()
        {
            string anyString   = "2";
            var    mockedview  = new Mock <IEditVenuesView>();
            var    mockService = new Mock <IVenueService>();
            var    mockedModel = new Mock <EditVenuesViewModel>();

            mockedview.Setup(x => x.Model).Returns(mockedModel.Object);
            mockService.Setup(x => x.FilterVenues(anyString, anyString));

            var actualInstance = new EditVenuesPresenter(mockedview.Object, mockService.Object);

            mockedview.Raise(x => x.QueryEvent += null, new SearchEventArgs(anyString, anyString));
            mockService.Verify(x => x.FilterVenues(anyString, It.Is <string>(y => y == anyString)), Times.Once);
        }
        public void View_UpdateVenueDetailsSholdCallVenueServiceUpdateVenueWithCorrectLatitude()
        {
            string expectedString = "expectedstring";
            double expectedDouble = 2.02;
            var    mockedview     = new Mock <IEditVenuesView>();
            var    mockService    = new Mock <IVenueService>();
            var    mockedModel    = new Mock <EditVenuesViewModel>();

            mockedview.Setup(x => x.Model).Returns(mockedModel.Object);
            mockService.Setup(x => x.UpdateVenue(expectedString, expectedDouble, expectedDouble, expectedString, expectedString, expectedString, expectedString, expectedString, expectedString));

            var actualInstance = new EditVenuesPresenter(mockedview.Object, mockService.Object);

            mockedview.Raise(x => x.UpdateVenueDetails += null, new UpdateVenueEventArgs(expectedString, expectedDouble, expectedDouble, expectedString, expectedString, expectedString, expectedString, expectedString, expectedString));
            mockService.Verify(x => x.UpdateVenue(expectedString, It.Is <double>(y => y == expectedDouble), expectedDouble, expectedString, expectedString, expectedString, expectedString, expectedString, expectedString), Times.Once);
        }
        public void View_GetVenuesByIdSholdCallVenueServiceGetVenueWithCorrectId()
        {
            string anyString   = "2";
            int    anyInt      = 2;
            var    mockedview  = new Mock <IEditVenuesView>();
            var    mockService = new Mock <IVenueService>();
            var    mockedModel = new Mock <EditVenuesViewModel>();

            mockedview.Setup(x => x.Model).Returns(mockedModel.Object);
            mockService.Setup(x => x.GetVenue(anyInt));

            var actualInstance = new EditVenuesPresenter(mockedview.Object, mockService.Object);

            mockedview.Raise(x => x.VenueDetailsId += null, new StringEventArgs(anyString));
            mockService.Verify(x => x.GetVenue(It.Is <int>(y => y == anyInt)), Times.Once);
        }