public void InvalidCardGivesException(DevelopmentCardType type) { var state1 = new Mock<IFlowSate>(); var state2 = new Mock<IFlowSate>(); var flowstates = new IFlowSate[] { state1.Object, state2.Object }; var factory = CreateFactory(); var provider = new StateProvider(flowstates, factory); Assert.Throws<ArgumentException>(() => provider.Get(type)); }
public void TestGetDevelopmentCard(DevelopmentCardType cardType, Type expectedState) { var state1 = new Mock<IFlowSate>(); var state2 = new Mock<IFlowSate>(); var flowstates = new IFlowSate[] { state1.Object, state2.Object }; var factory = CreateFactory(); var provider = new StateProvider(flowstates, factory); var result = provider.Get(cardType); Assert.IsAssignableFrom(expectedState, result); }