public async Task IF_extraction_fails_SHOULD_fail() { //Arrange MockNativeNotificationExtractor.Where_ExtractNotification_fails(Error.Create("fail!")); //Act var result = await Sut.SendNotificationToTargetAsync(_pushNotification, _target, MockNotificationHub.Object); //Assert Assert.AreEqual("fail!", result.Error.Description); }
public override void SetUp() { base.SetUp(); _iosNotification = new AppleNotification("{}"); MockNativeNotificationExtractor.Where_ExtractNotification_returns(new NativeNotification(_iosNotification)); _pushNotification = new PushNotificationMockBuilder() .With(x => x.Name, "TestNotificationType") .With(x => x.Title, "News Alert") .With(x => x.Body, "The lockdown is only in your mind") .With(x => x.DataProperties, new Dictionary <string, object> { { "FavouriteColour", "Red" }, { "FavouriteBand", "The Beatles" }, { "Id", _id }, }).Object; _target = DeviceTarget.Android("pnsHandle"); }