Ejemplo n.º 1
0
        public async Task SendPushNotification()
        {
            var databaseRepositoryMock = new Mock <IDatabaseRepository>();
            var container = new WindsorContainer();

            container.Kernel.ComponentModelBuilder.AddContributor(new SingletonEqualizer());
            container.Install(new ConfigurationInstaller());

            var pushTokens = new List <PushTokenItem> {
                new PushTokenItem {
                    Token = "https://android.googleapis.com/gcm/send/dCq5No2sfoI:APA91bHiWc9EQ1hSR1lmiAWJVJysgF8-9BAC6lQb20OwusXTVNblCX1J9YejjUgQdEB_QMm_4YwJQ05OsQhOF7yXs8dUmbAxSzdCnSP6YkGFRxfbM0Iu-1V20aXsZJ9uPS00jnZ6MQgH", UserId = ""
                }
            };

            databaseRepositoryMock.Setup(x => x.GetPushTokens()).ReturnsAsync(pushTokens);

            var sut = new PushTokenService(container.Resolve <IConfigurationService>(), databaseRepositoryMock.Object);
            await sut.SendPushNotification();
        }
 public PushTokenServiceTestSuite()
 {
     PushTokenRepositoryMock = new Mock <IPushTokenRepository>();
     UserServiceMock         = new Mock <IUserService>();
     PushTokenService        = new PushTokenService(PushTokenRepositoryMock.Object, UserServiceMock.Object);
 }