Ejemplo n.º 1
0
        public void GetAllClassRecordsFromDbContextGreaterThanZeroRecords()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new ClassRepo(dbContext);

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count > 0);
        }
Ejemplo n.º 2
0
        public void GetAllClassRecordsFromDbContextNotNull()
        {
            var dbContext    = new SQLConnType(@"localhost\SQLEXPRESS14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new ClassRepo(dbContext);

            var result = sysUnderTest.GetAllAsync();

            Assert.NotNull(result);
        }
Ejemplo n.º 3
0
        public void DeleteAllClassRecords_Succeed()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new ClassRepo(dbContext);

            sysUnderTest.DeleteAllAsync();

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count == 0);
        }
Ejemplo n.º 4
0
        public void DeleteClassRecordByID_Succeed()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new ClassRepo(dbContext);
            var classEnt     = new ClassEntity("50f14850-1161-4b7f-8093-af335090268f");

            sysUnderTest.DeleteByIdAsync(classEnt.Id);

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count > 0);
        }
Ejemplo n.º 5
0
        public void InsertClassRecord_Succeed()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new ClassRepo(dbContext);
            var classEnt     = new ClassEntity(Guid.NewGuid().ToString());

            classEnt.ClassName   = "English";
            classEnt.Description = "English Poetry";

            sysUnderTest.InsertEntityAsync(classEnt);

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count > 0);
        }