public void QueryState_WithNoItemInContext_ReturnsDisabled() { // Arrange var sheer = Substitute.For <ISheerResponse>(); var contextChecker = Substitute.For <ICommandContextChecker>(); var locator = Substitute.For <IDialogLocator>(); var processor = Substitute.For <IDialogResultProcessor>(); var command = new SelectBaseLayout(sheer, contextChecker, locator, processor); var context = new CommandContext(); // Act var result = command.QueryState(context); // Assert Assert.Equal(CommandState.Disabled, result); }
public void QueryState_WhenContextCheckerReturnsTrue_ReturnsEnabled() { // Arrange var sheer = Substitute.For <ISheerResponse>(); var contextChecker = Substitute.For <ICommandContextChecker>(); contextChecker.CanExecute(Arg.Any <Item>()).Returns(true); var locator = Substitute.For <IDialogLocator>(); var processor = Substitute.For <IDialogResultProcessor>(); var command = new SelectBaseLayout(sheer, contextChecker, locator, processor); var context = new CommandContext(MasterFakesFactory.CreateFakeItem()); // Act var result = command.QueryState(context); // Assert Assert.Equal(CommandState.Enabled, result); }