public void ConvertViberActivityToOmniViberFailoverMessage()
        {
            var expected = new InfobipOmniViberMessage
            {
                Text                   = "text",
                ImageUrl               = "image url",
                ButtonText             = "button text",
                ButtonUrl              = "button url",
                IsPromotional          = true,
                TrackingData           = "tracking-data",
                ValidityPeriod         = 10,
                ValidityPeriodTimeUnit = InfobipViberOptions.ValidityPeriodTimeUnitTypes.Days
            };

            _activity.AddInfobipViberMessage(expected);

            var viberMessages = InfobipOmniViberMessageFactory.Create(_activity);

            Assert.NotNull(viberMessages);
            Assert.Single(viberMessages);

            var viberMessage = viberMessages.Single();

            Assert.NotNull(viberMessage);
            Assert.Equal(expected.Text, viberMessage.Text);
            Assert.Equal(expected.ButtonText, viberMessage.ButtonText);
            Assert.Equal(viberMessage.ButtonUrl, viberMessage.ButtonUrl);
            Assert.Equal(expected.ImageUrl, viberMessage.ImageUrl);
            Assert.Equal(expected.IsPromotional, viberMessage.IsPromotional);
            Assert.Equal(expected.TrackingData, viberMessage.TrackingData);
            Assert.Equal(expected.ValidityPeriodTimeUnit, viberMessage.ValidityPeriodTimeUnit);
            Assert.Equal(expected.ValidityPeriod, viberMessage.ValidityPeriod);
        }
        public void ConvertTextActivityToOmniViberFailoverMessage()
        {
            _activity.Text = "Test text";

            var viberMessages = InfobipOmniViberMessageFactory.Create(_activity);

            Assert.NotNull(viberMessages);
            Assert.Single(viberMessages);

            var viberMessage = viberMessages.Single();

            CheckViberTextMessage(viberMessage, _activity.Text);
        }
        public void ConvertViberActivityWithoutButtonUrlTextToOmniViberFailoverMessage()
        {
            var expected = new InfobipOmniViberMessage
            {
                Text                   = "text",
                ImageUrl               = "image url",
                ButtonUrl              = "button url",
                IsPromotional          = true,
                TrackingData           = "tracking-data",
                ValidityPeriod         = 10,
                ValidityPeriodTimeUnit = InfobipViberOptions.ValidityPeriodTimeUnitTypes.Days
            };

            _activity.AddInfobipViberMessage(expected);

            Assert.Throws <Exception>(() => InfobipOmniViberMessageFactory.Create(_activity));
        }