コード例 #1
0
        public async Task CheckDuplicateStudentSurname_Edit2()
        {
            StudentBL sAPI   = new StudentBL(sService);
            var       result = await sAPI.AddStudentAsync(new folio1_app_test.Models.Student {
                Id = 1, FolioClassId = 4, FirstName = "Johnathon", LastName = "Johnston", Age = 18, GPA = 3.2
            });

            //Updating the student with someone else's lastname, so it should not allow
            Assert.False(result.IsSuccess);
        }
コード例 #2
0
        public async Task CheckDuplicateStudentSurname_Add()
        {
            StudentBL sAPI   = new StudentBL(sService);
            var       result = await sAPI.AddStudentAsync(new folio1_app_test.Models.Student {
                Id = 0, FolioClassId = 4, FirstName = "Johnathon", LastName = "Packer", Age = 18, GPA = 3.2
            });

            //Packer surname is already added so it wont allow another Packer to be added
            Assert.False(result.IsSuccess);
        }
コード例 #3
0
        public async Task CheckDuplicateStudentSurname_Add2()
        {
            StudentBL sAPI   = new StudentBL(sService);
            var       result = await sAPI.AddStudentAsync(new folio1_app_test.Models.Student {
                Id = 0, FolioClassId = 4, FirstName = "Johnathon", LastName = "PackerNew", Age = 18, GPA = 3.2
            });

            //PackerNew surname is not there in the collection so it will allow surname to be added
            Assert.True(result.IsSuccess);
        }