Ejemplo n.º 1
0
        public async Task PushNotifications_SendsToCorrectChannels()
        {
            Notification1 n1First  = new Notification1();
            Notification1 n1Second = new Notification1();
            Notification2 n2       = new Notification2();
            await sut.PushNotifications(new INotification[] { n1First, n2, n1Second });

            notificationChannel1.Received(1).PushNotificationAsync(n1First);
            notificationChannel1.Received(1).PushNotificationAsync(n1Second);
            notificationChannel2.Received(1).PushNotificationAsync(n2);
        }
Ejemplo n.º 2
0
        public async Task PushNotification_SendsToCorrectChannels()
        {
            Notification1 n1 = new Notification1();
            Notification2 n2 = new Notification2();
            await sut.PushNotification(n1);

            await sut.PushNotification(n2);

            notificationChannel1.Received(1).PushNotificationAsync(n1);
            notificationChannel2.Received(1).PushNotificationAsync(n2);
        }