public void NotRegisteredServiceThrows() { // Arrange IViewServiceRepository repo = new ViewServiceRepository(); // Act // Assert ExceptionAssert.Throws<InvalidOperationException, object>( () => repo.Execute<IDummyService>() ); }
public void ServiceResultIsCasted() { // Arrange var serviceMock = new Mock<IViewService>(); serviceMock.Setup( s => s.Execute( It.IsAny<MetroWindow>(), It.IsAny<object>() ) ).Returns( Task.FromResult( (object)123 ) ); IViewServiceRepository repo = new ViewServiceRepository(); repo.Register<IDummyService>( serviceMock.Object ); // Act int result = repo.Execute<IDummyService, int>().Result; // Assert Assert.AreEqual( 123, result ); serviceMock.VerifyAll(); }
private async void ExecuteReplyCommand() { await ViewServiceRepository.ReplyToMessage(this); }
private async void ExecuteRetweetStatusCommand() { await ViewServiceRepository.RetweetStatus(this); }
private async void ExecuteReplyToAllCommand() { await ViewServiceRepository.ReplyToTweet(this, true); }
private async void ExecuteQuoteStatusCommand() { await ViewServiceRepository.QuoteTweet(this); }
private async void ExecuteSettingsCommand() { await ViewServiceRepository.ShowSettings(); }
private async void ExecuteSearchCommand() { await ViewServiceRepository.OpenSearch(); }
private async void ExecuteNewTweetCommand() { await ViewServiceRepository.ComposeTweet(); }
private async void ExecuteNewMessageCommand() { await ViewServiceRepository.ComposeMessage(); }
private async void ExecuteInfoCommand() { await ViewServiceRepository.ShowInfo(); }
private async void ExecuteAddColumnCommand() { await ViewServiceRepository.ShowAddColumnDialog(); }
private async void ExecuteAccountsCommand() { await ViewServiceRepository.ShowAccounts(); }
private async void ExecuteQuoteCommand() { await ViewServiceRepository.QuoteTweet(Status, Accounts.Where( a => a.Use ).Select(a => a.Context.UserId)); Close(true); }