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