public Task ExecuteAsync(DeleteCountryCommand command) { var locationDomain = new LocationDomain(_domainService.WriteService); locationDomain.DeleteCountry(command.Id); _domainService.ApplyChanges(locationDomain); return(Task.CompletedTask); }
public Task ExecuteAsync(UpdateCountryCommand command) { var locationDomain = new LocationDomain(_domainService.WriteService); locationDomain.UpdateCountry(command.Id, command.Name, command.IsoCode, command.DisplayOrder, command.Published); _domainService.ApplyChanges(locationDomain); return(Task.CompletedTask); }
public void GetLocation_NullTemplate() { var item = Mock.Of <IItem>(); var repository = Mock.Of <ISitecoreRepository>(); var domain = new LocationDomain(repository); var location = domain.GetLocation(item); Assert.IsNull(location); }
public void GetFieldParameters_IncorrectKeyValuePair() { var repository = Mock.Of <ISitecoreRepository>(); var domain = new LocationDomain(repository); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("Image", "?mh=200"); var parameterString = domain.GetFieldParameters("Text", dictionary); Assert.AreEqual(null, parameterString); }
public void LocationControllerTest_ReturnsPageEditorErrorIfNoLocation() { var repository = Mock.Of <ISitecoreRepository>(); var pageContext = Mock.Of <IPageContext>(pc => pc.IsPageEditor == true); var rendering = Mock.Of <IRenderingWrapper>(); var renderingContext = Mock.Of <IRenderingContext>(rc => rc.Rendering == rendering); LocationDomain domain = new LocationDomain(repository); LocationController locationController = new LocationController(domain, pageContext, renderingContext); var result = locationController.Featured() as ViewResult; Assert.AreEqual("~/Views/Shared/_NoDatasource.cshtml", result.ViewName); }
public void LocationControllerTest_ReturnsEmptyIfNoLocation() { var repository = Mock.Of <ISitecoreRepository>(); var pageContext = Mock.Of <IPageContext>(); var rendering = Mock.Of <IRenderingWrapper>(); var renderingContext = Mock.Of <IRenderingContext>(rc => rc.Rendering == rendering); LocationDomain domain = new LocationDomain(repository); LocationController locationController = new LocationController(domain, pageContext, renderingContext); var result = locationController.Featured(); Assert.AreEqual("EmptyResult", result.GetType().Name); }