Пример #1
0
        public void InsertTestResults_TwoDistinctStudents_TwoRowsAffected()
        {
            MarkrApiBusinessLogic.DeleteTestResults(testIdForUnitTests);

            var testResults = Deserialize("TestInputs/InsertTestResults_TwoDistinctStudents_TwoRows.xml");

            var importResults = MarkrApiBusinessLogic.ImportTestResults(testResults);

            Assert.AreEqual(importResults.RowsParsed, 2);
            Assert.AreEqual(importResults.RowsAccepted, 2);
        }
Пример #2
0
        public void InsertTestResults_TwoDuplicateStudents_CorrectOneInserted()
        {
            //The TestId 1 is reserved for test data. We should have appropriate error handling in the application to ensure that
            MarkrApiBusinessLogic.DeleteTestResults(testIdForUnitTests);

            var testResults = Deserialize("TestInputs/InsertTestResults_TwoDuplicateStudents_CorrectOneInserted.xml");

            var importResults = MarkrApiBusinessLogic.ImportTestResults(testResults);

            var testResultsInDB = MarkrApiBusinessLogic.GetTestResults(testIdForUnitTests);

            Assert.AreEqual(importResults.RowsParsed, 2);
            Assert.AreEqual(importResults.RowsAccepted, 2);
            Assert.AreEqual(testResultsInDB.Count, 1);
            Assert.IsTrue(testResultsInDB.Exists(r => r.MarksObtained == 13));
        }