public MainWindow()
        {
            var queryService = new BasicQueryService(webService: new AutotaskWebService());

            LoginViewModel = new LoginViewModel(queryService);
            QueryToolViewModel = new QueryToolViewModel(queryService);

            LoginViewModel.PropertyChanged += HandleLoginPropertyChanged;
            DataContext = this;

            InitializeComponent();
        }
 public void BeforeEachTest()
 {
     Service = Mock.Create<IQueryService>();
     Target = new LoginViewModel(Service);
 }
            public void Execute_Uses_PasswordBox_Password_Property()
            {
                string pass = "******";
                Target = new LoginViewModel(Service) { Username = "******" };
                Mock.Arrange(() => Service.Login(Arg.IsAny<string>(), pass)).MustBeCalled();
                Target.Login.Execute(new PasswordBox() { Password = pass });

                Mock.Assert(Service);
            }
            public void Execute_Invokes_Service_Login()
            {
                Target = new LoginViewModel(Service) { Username = "******" };
                Mock.Arrange(() => Service.Login(Arg.IsAny<string>(), Arg.IsAny<string>())).MustBeCalled();
                Target.Login.Execute(PopulatedBox);

                Mock.Assert(Service);
            }