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); }
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()); } }