Exemplo n.º 1
0
        public void ExerciseTestCaseResultField()
        {
            // TODO: repurpose test cases to exercise resetting

            List <BaseTestCase> myTests         = BaseTestCase.LoadTests("SampleConfigFile.json");
            CommandTestCase     commandTestCase = myTests[0] as CommandTestCase;

            Assert.IsTrue(commandTestCase.ActualReturnCode == 0);
            commandTestCase.ActualReturnCode = 1;
            commandTestCase.CaseStatus       = BaseTestCase.TestCaseStatus.FINISHED;
            Assert.IsTrue(commandTestCase.ActualReturnCode == 1);
            Assert.IsTrue(commandTestCase.CaseStatus == BaseTestCase.TestCaseStatus.FINISHED);
            commandTestCase.ClearTestResult();
            Assert.IsTrue(commandTestCase.ActualReturnCode == 0);
            Assert.IsTrue(commandTestCase.CaseStatus == BaseTestCase.TestCaseStatus.NOT_YET_RUN);
        }
        public void LoadTestCaseFromJson()
        {
            /**
             * Hello world goal:
             * Execute a command based on the loaded json
             *
             * later on: group of tests that define success
             * for now, keep it simple. all or nothing
             */
            List <BaseTestCase> myTests = BaseTestCase.LoadTests("SampleConfigFile.json");

            Assert.IsTrue(myTests.Count == 2);
            Assert.IsTrue(myTests[0].TestName == "My test case");
            Assert.IsTrue(myTests[0] is CommandTestCase);
            CommandTestCase commandTestCase = myTests[0] as CommandTestCase;

            //Assert.IsTrue(commandTestCase.TestCommand == "c:\\Some command.exe");
            Assert.IsTrue(commandTestCase.ExpectedResponseCode == 0);
            Assert.IsTrue(commandTestCase.Params == "-param1 -param2 3");
        }
Exemplo n.º 3
0
 public virtual void TestNotEnoughArgumentsResourceNotEmpty()
 {
     Assert.IsNotEmpty(CommandTestCase.FromResource("NotEnoughArguments"));
 }