예제 #1
0
 public MainViewModel()
 {
     NewCommand     = new AppCommand(OnNewCommand);
     ReceiveCommand = new AppCommand(OnReceiveCommand);
     UpdateCommand  = new AppCommand(OnUpdateCommand);
     SendCommand    = new AppCommand(OnSendCommand, OnCanSendCommand);
     Messages       = new ObservableCollection <MessageModel>();
     DBContext      = new AppDBContext();
     UpdateCommand.Execute(null);
 }
예제 #2
0
        public void ShouldWriteApplicationsToConsole([Frozen] Mock <IAppHarborClient> client, Mock <TextWriter> writer, List <Application> applications, AppCommand command)
        {
            applications.Add(new Application {
                Slug = "foo"
            });
            applications.Add(new Application {
                Slug = "bar"
            });

            client.Setup(x => x.GetApplications()).Returns(applications);

            command.Execute(new string[0]);

            foreach (var application in applications)
            {
                writer.Verify(x => x.WriteLine(application.Slug), Times.Once());
            }
        }