Exemplo n.º 1
0
        public async Task SelectProjectCommandClearsProject()
        {
            // Arrange
            using var mock = AutoMock.GetLoose();
            var context = mock.Mock <IUpgradeContext>();

            var command = new SelectProjectCommand();

            // Act
            var result = await command.ExecuteAsync(context.Object, CancellationToken.None).ConfigureAwait(true);

            // Assert
            Assert.True(result);
            Assert.Equal("Select different project", command.CommandText);
            Assert.True(command.IsEnabled);
            context.Verify(c => c.SetCurrentProject(null), Times.Once);
        }
Exemplo n.º 2
0
        public async Task NegativeSelectProjectCommandTests()
        {
            var command = new SelectProjectCommand();

            await Assert.ThrowsAsync <ArgumentNullException>("context", () => command.ExecuteAsync(null !, CancellationToken.None)).ConfigureAwait(true);
        }