public void DeleteProductCommandCanExecuteWhenProductIsSelected() { // Fixture setup var fixture = new AutoMoqFixture(); var sut = fixture.CreateAnonymous <MainWindowViewModel>(); sut.Products.Add(fixture.Build <ProductViewModel>() .With(x => x.IsSelected, true) .CreateAnonymous()); // Exercise system var result = fixture.Get((object p) => sut.DeleteProductCommand.CanExecute(p)); // Verify outcome Assert.True(result, "DeleteProductCommand"); // Teardown }
public void DeleteProductCommandCanExecuteWhenProductIsSelected() { // Fixture setup var fixture = new AutoMoqFixture(); var sut = fixture.CreateAnonymous<MainWindowViewModel>(); sut.Products.Add(fixture.Build<ProductViewModel>() .With(x => x.IsSelected, true) .CreateAnonymous()); // Exercise system var result = fixture.Get((object p) => sut.DeleteProductCommand.CanExecute(p)); // Verify outcome Assert.True(result, "DeleteProductCommand"); // Teardown }