Ejemplo n.º 1
0
        public void NotRegisteredServiceThrows()
        {
            // Arrange
            IViewServiceRepository repo = new ViewServiceRepository();

            // Act

            // Assert
            ExceptionAssert.Throws<InvalidOperationException, object>( () => repo.Execute<IDummyService>() );
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 private async void ExecuteReplyCommand()
 {
     await ViewServiceRepository.ReplyToMessage(this);
 }
Ejemplo n.º 4
0
 private async void ExecuteRetweetStatusCommand()
 {
     await ViewServiceRepository.RetweetStatus(this);
 }
Ejemplo n.º 5
0
 private async void ExecuteReplyToAllCommand()
 {
     await ViewServiceRepository.ReplyToTweet(this, true);
 }
Ejemplo n.º 6
0
 private async void ExecuteQuoteStatusCommand()
 {
     await ViewServiceRepository.QuoteTweet(this);
 }
Ejemplo n.º 7
0
 private async void ExecuteSettingsCommand()
 {
     await ViewServiceRepository.ShowSettings();
 }
Ejemplo n.º 8
0
 private async void ExecuteSearchCommand()
 {
     await ViewServiceRepository.OpenSearch();
 }
Ejemplo n.º 9
0
 private async void ExecuteNewTweetCommand()
 {
     await ViewServiceRepository.ComposeTweet();
 }
Ejemplo n.º 10
0
 private async void ExecuteNewMessageCommand()
 {
     await ViewServiceRepository.ComposeMessage();
 }
Ejemplo n.º 11
0
 private async void ExecuteInfoCommand()
 {
     await ViewServiceRepository.ShowInfo();
 }
Ejemplo n.º 12
0
 private async void ExecuteAddColumnCommand()
 {
     await ViewServiceRepository.ShowAddColumnDialog();
 }
Ejemplo n.º 13
0
 private async void ExecuteAccountsCommand()
 {
     await ViewServiceRepository.ShowAccounts();
 }
Ejemplo n.º 14
0
        private async void ExecuteQuoteCommand()
        {
            await ViewServiceRepository.QuoteTweet(Status, Accounts.Where( a => a.Use ).Select(a => a.Context.UserId));

            Close(true);
        }