コード例 #1
0
ファイル: BLLottoTests.cs プロジェクト: jannehakala/IIO11300
        public void ReadLottoNumbersTest() {
            lotto = new BLLotto();
            string path = "Lottorivit" + lotto.GetWeekNumber() + ".txt";
            int[] test = lotto.ReadLottoNumbers("1 2 3 4 5 6 8");

            Assert.IsTrue(File.Exists(path), "File does not exist.");         
            Assert.AreEqual(test[0], 6, "Results should be equal");        
        }
コード例 #2
0
ファイル: BLLottoTests.cs プロジェクト: jannehakala/IIO11300
 public void WriteLottoNumbersTest() {
     lotto = new BLLotto();
     string path = "Lottorivit" + lotto.GetWeekNumber() + ".txt";
     string input = "Row 1: 1, 2, 3, 4, 5, 6, 7";
     string correctRow = "1 2 3 4 5 6 7";
     lotto.WriteLottoNumbers(input);
     
     Assert.IsTrue(File.Exists(path), "File does not exist.");     
     Assert.IsTrue((File.ReadAllText(path).Contains(correctRow)), "File does not include the written row.");      
 }