コード例 #1
0
ファイル: StorageTest.cs プロジェクト: featherly/rps-sample
        public void ConvertToHistoryEnumListHandleEmptyList()
        {
            //initialize
            Storage target = new Storage();
            string asString = string.Empty;
            List<OutcomeEnum> expected = null;
            List<OutcomeEnum> actual;

            //setup
            actual = target.ConvertToHistoryEnumList(asString);

            //assert
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
ファイル: StorageTest.cs プロジェクト: featherly/rps-sample
        public void ConvertToHistoryEnumListHandleValidList()
        {
            //initialize
            Storage target = new Storage();
            string asString = "Rr";
            List<OutcomeEnum> expected = new List<OutcomeEnum>() { OutcomeEnum.WinWithRock, OutcomeEnum.LoseWithRock };
            List<OutcomeEnum> actual;

            //setup
            actual = target.ConvertToHistoryEnumList(asString);

            //assert
            for (int index = 0; index < Math.Min(expected.Count, actual.Count); index++)
            {
                Assert.AreEqual(expected[index], actual[index]);
            }
        }