示例#1
0
 public void TestCellPrinter1()
 {
     try
     {
         CellPrinter print = testex1.Method1() as CellPrinter;
         Assert.IsTrue(true);
     }
     catch (System.Exception)
     {
         Assert.IsTrue(false);
     }
 }
示例#2
0
        public void Ex1Methd1_position()
        {
            Exercise1   ex1 = new Exercise1();
            CellPrinter cp  = (CellPrinter)ex1.Method1();

            Assert.Equal("Cell is on Position X:1 Y:1", cp.PrintPostion(1, 1));
        }
示例#3
0
        public void Ex1Methd1_notalive()
        {
            Exercise1   ex1 = new Exercise1();
            CellPrinter cp  = (CellPrinter)ex1.Method1();

            Assert.Equal($"Cell red born on {System.DateTime.Now} is not alive", cp.PrintState(false, System.DateTime.Now, "red"));
        }
示例#4
0
        public void Exercise1Method1Test3()
        {
            Exercise1   e1             = new Exercise1();
            CellPrinter returnedObject = (CellPrinter)e1.Method1();

            Assert.AreEqual(returnedObject.PrintState(true, new System.DateTime(2019, 12, 12), "red"), "Cell red born on 12.12.2019 is alive");
        }
示例#5
0
        public void Exercise1Method1Test2()
        {
            Exercise1   e1             = new Exercise1();
            CellPrinter returnedObject = (CellPrinter)e1.Method1();

            Assert.AreEqual(returnedObject.PrintPostion(1, 2), "Cell is on Position X:1 Y:2");
        }
示例#6
0
        public void Ex1Test1()
        {
            Exercise1   ex1         = new Exercise1();
            CellPrinter cellPrinter = (CellPrinter)ex1.Method1();

            Assert.AreEqual(cellPrinter.PrintState(true, System.DateTime.Now, "red"), $"Cell red born on {System.DateTime.Now} is alive");
        }
示例#7
0
        public void Ex1Test2()
        {
            Exercise1   ex1         = new Exercise1();
            CellPrinter cellPrinter = (CellPrinter)ex1.Method1();

            Assert.AreEqual(cellPrinter.PrintPostion(1, 1), "Cell is on Position X:1 Y:1");
        }
        public void Test1()
        {
            var exercise1 = new Exercise1();

            var method1 = exercise1.Method1();

            Assert.NotNull(method1);
        }
示例#9
0
        public void Exercise1Method1Test1()
        {
            Exercise1   e1             = new Exercise1();
            CellPrinter returnedObject = (CellPrinter)e1.Method1();
            CellPrinter expectedObject = new CellPrinter();

            Assert.AreEqual(returnedObject.GetType(), expectedObject.GetType());
        }
示例#10
0
 public void TestIfInstanceIsCellPrinter()
 {
     if (ex1.Method1().GetType() == typeof(CellPrinter))
     {
         Assert.IsTrue(true);
     }
     else
     {
         Assert.IsTrue(false);
     }
 }