Exemplo n.º 1
0
        public async Task AddSubmissionToStudentSubmission_ShouldReturnIdNotNull()
        {
            await GeneratorObj.AddSubmissionToStudentSubmission(
                MockSnapshots.GetThirdCalculatorSnapshotName());

            var actual = (await SnapshotSubmission.GetAll()).Count();

            Assert.AreNotEqual(0, actual);
        }
Exemplo n.º 2
0
        public async Task AddSubmissionToStudentSubmission_ShouldAddToStudentCollection()
        {
            var expected = (await SnapshotSubmission.GetAll()).Count() + 1;
            await GeneratorObj.AddSubmissionToStudentSubmission(
                MockSnapshots.GetThirdCalculatorSnapshotName());

            var actual = (await SnapshotSubmission.GetAll()).Count();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public async Task AddSubmissionToStudentSubmission_UnzipFilesShouldGetFile()
        {
            var snapshotSubmission = await GeneratorObj.AddSubmissionToStudentSubmission(
                MockSnapshots.GetThirdCalculatorSnapshotName());

            var files    = (await SnapshotSubmission.Get(snapshotSubmission.Id)).Files;
            var snapshot = "Snapshot";

            EngineFileUtilities.ExtractZip(Data.Root, snapshot, files);

            var path = Path.Combine(Data.Root, snapshot, MockSnapshots.GetCalculatorFile());

            Assert.IsTrue(File.Exists(path));
        }
Exemplo n.º 4
0
 public void AreSnapshotsSame_ShouldReturnFalseForDifferentSnapshot()
 {
     Assert.IsFalse(GeneratorObj.AreSnapshotsTheSame(
                        Data.SnapshotSourceFileFullPath(MockSnapshots.GetThirdCalculatorSnapshotName(),
                                                        MockSnapshots.GetCalculatorFile()), MockSnapshots.GetCalculatorFile()));
 }