Ejemplo n.º 1
0
        public void TypeMatching_should_throw_CardActionAssertionFailedException_for_non_matching_types()
        {
            var type       = CardActionTypeMap.Map(CardActionType.Call);
            var cardAction = new CardAction(type: type);

            var sut = new CardActionAssertions(cardAction);

            Action act = () => sut.ActionType(CardActionType.DownloadFile);

            act.ShouldThrow <CardActionAssertionFailedException>();
        }
Ejemplo n.º 2
0
        internal static List <CardAction> CreateRandomCardActions()
        {
            var cardActions = new List <CardAction>();
            var types       = Enum.GetValues(typeof(CardActionType)).Cast <CardActionType>().ToList();

            for (var i = 0; i < 5; i++)
            {
                var type = CardActionTypeMap.Map(types[i % types.Count]);
                cardActions.Add(new CardAction(type, $"title{i}", $"image{i}", $"value{i}"));
            }
            return(cardActions);
        }
Ejemplo n.º 3
0
        public void TypeMatching_should_not_throw_when_card_action_type_matches_expected_type()
        {
            const CardActionType call = CardActionType.Call;
            var type       = CardActionTypeMap.Map(call);
            var cardAction = new CardAction(type: type);

            var sut = new CardActionAssertions(cardAction);

            Action act = () => sut.ActionType(call);

            act.ShouldNotThrow <Exception>();
        }
Ejemplo n.º 4
0
        public ICardActionAssertions ActionType(CardActionType type)
        {
            _stringHelpers.TestForMatch(_cardAction.Type, CardActionTypeMap.Map(type), CreateEx(nameof(_cardAction.Type), type.ToString()));

            return(this);
        }