public void ShouldReturnRootItem() { // arrange var rootItem = ItemHelper.CreateInstance(this.database); dataStorage.GetSitecoreItem(ItemIDs.RootID, rootItem.Language).Returns(rootItem); var command = new OpenGetRootItemCommand { Engine = new DataEngine(this.database) }; command.Initialize(LanguageManager.DefaultLanguage, Version.Latest); command.Initialize(this.dataStorage); // act var result = command.DoExecute(); // assert result.Should().Be(rootItem); }
public void ShouldCreateInstance() { // arrange var command = new OpenGetRootItemCommand(); command.Initialize(this.dataStorage); // act & assert command.CreateInstance().Should().BeOfType<GetRootItemCommand>(); }
public void ShouldCreateInstance() { // arrange var command = new OpenGetRootItemCommand(); command.Initialize(this.dataStorage); // act & assert command.CreateInstance().Should().BeOfType <GetRootItemCommand>(); }
public void ShouldReturnRootItem() { // arrange var rootItem = ItemHelper.CreateInstance(this.database); dataStorage.GetSitecoreItem(ItemIDs.RootID, rootItem.Language).Returns(rootItem); var command = new OpenGetRootItemCommand { Engine = new DataEngine(this.database) }; command.Initialize(LanguageManager.DefaultLanguage, Version.Latest); command.Initialize(this.dataStorage); // act var result = command.DoExecute(); // assert result.Should().Be(rootItem); }
public void ShouldCreateInstance() { // arrange var createdCommand = Substitute.For<GetRootItemCommand>(); this.innerCommand.CreateInstance<Sitecore.Data.Engines.DataCommands.GetRootItemCommand, GetRootItemCommand>().Returns(createdCommand); var command = new OpenGetRootItemCommand(); command.Initialize(this.innerCommand); // act & assert command.CreateInstance().Should().Be(createdCommand); }