示例#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>();
        }
示例#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);
        }
示例#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>();
        }
示例#4
0
        public ICardActionAssertions ActionType(CardActionType type)
        {
            _stringHelpers.TestForMatch(_cardAction.Type, CardActionTypeMap.Map(type), CreateEx(nameof(_cardAction.Type), type.ToString()));

            return(this);
        }