コード例 #1
0
ファイル: StateProviderTest.cs プロジェクト: Corne/VOC
        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));
        }
コード例 #2
0
ファイル: StateProviderTest.cs プロジェクト: Corne/VOC
        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);
        }