コード例 #1
0
        private async Task <TestCaseValidation> GetTestCaseValidation(string url, string testCase)
        {
            HttpResponseMessage response = await _httpClient.GetAsync(url + testCase);

            string jobOrdering = await response.Content.ReadAsStringAsync();

            VerifyJobOrder verifyJobOrder = new VerifyJobOrder(testCase, jobOrdering);
            bool           passOrFail     = verifyJobOrder.IsValid();

            return(new TestCaseValidation(testCase, passOrFail));
        }
コード例 #2
0
        public void WrongJobReturnedTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-", "b");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #3
0
        public void EmptyJobListTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("", "");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(true));
        }
コード例 #4
0
        public void CheckIfCircularDependencyNotCorrectTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-b|b-c|c-", "Can not resolve circular dependency");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #5
0
        public void CheckForJobDependingOnItselfNotCorrectTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-b|b-c|c-", "Can not resolve job depending on itself");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #6
0
        public void ExtraJobNotAddedToStringTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-|b-|c-|d-|e-|f-", "cbaed");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #7
0
        public void FiveJobsFourDependenciesWithIncorrectOrderTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-b|b-c|c-|d-b|e-d", "cbaed");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #8
0
        public void FiveJobsFourDependenciesTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-b|b-c|c-|d-b|e-d", "cbade");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(true));
        }
コード例 #9
0
        public void ThreeJobsOneDependencyWrongOrderTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-b|b-|c-", "abc");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #10
0
        public void ThreeJobsOneDependencyDifferentOrderTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-b|b-|c-", "bac");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(true));
        }
コード例 #11
0
        public void JobNotInListTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-|b-", "bac");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(false));
        }
コード例 #12
0
        public void TwoJobsSwitchedOrderTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-|b-", "ba");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(true));
        }
コード例 #13
0
        public void TwoJobsNoDependenciesTest()
        {
            VerifyJobOrder verifyJobOrder = new VerifyJobOrder("a-|b-", "ab");

            Assert.That(verifyJobOrder.IsValid(), Is.EqualTo(true));
        }