Example #1
0
        public void CheckIfNewMemeberHasBeenAddedToDB()
        {
            //Arrange
            _crudMem.CreateMember("00728", "Paul", "Merch");
            //Act
            var newMember = _context.Members.Find("00728");

            Assert.That(newMember, Is.Not.Null);
            //Assert
            Assert.That(newMember.FirstName, Is.EqualTo("Paul"));
            Assert.That(newMember.LastName, Is.EqualTo("Merch"));
        }
Example #2
0
        public void OneTimeSetup()
        {
            var options = new DbContextOptionsBuilder <TeamFinder3TAppContext>()
                          .UseInMemoryDatabase(databaseName: "FakeTeamFinderDb")
                          .Options;

            _context = new TeamFinder3TAppContext(options);
            MemberService memberService = new MemberService(_context);

            _crudMem = new CRUDoperationsForMembers(memberService);

            _crudMem.CreateMember("00001", "Test", "Member");
            _crudMem.CreateMember("00002", "Bob", "Tester");
            _crudMem.CreateMember("00003", "Craig", "Item");
            _crudMem.CreateMember("00004", "Will", "Potter");
        }
        public void OneTimeSetup()
        {
            var options = new DbContextOptionsBuilder <TeamFinder3TAppContext>()
                          .UseInMemoryDatabase(databaseName: "FakeTeamFinderDb")
                          .Options;

            _context = new TeamFinder3TAppContext(options);
            SquadService squadService = new SquadService(_context);

            _crudSquad = new CRUDoperationsForSquad(squadService);
            MemberService memService = new MemberService(_context);

            _crudMember = new CRUDoperationsForMembers(memService);
            SquadMemberService squaMemService = new SquadMemberService(_context);

            _crudSquadMembers = new CRUDoperationsForSquadMembers(squaMemService);

            _crudSquad.CreateSquad("0102133", "Anthony Barry", 5, "Football");
            _crudSquad.CreateSquad("3900011", "Frank Lampard", 5, "Football");

            _crudMember.CreateMember("03930", "Andy", "Robertson");
            _crudMember.CreateMember("01002", "Diogo", "Jota");
            _crudMember.CreateMember("29390", "Sadio", "Mane");
            _crudMember.CreateMember("29312", "Mohammed", "Salah");
            _crudMember.CreateMember("29390", "Joel", "Matip");
            _crudMember.CreateMember("28199", "Timo", "Werner");
            _crudMember.CreateMember("77282", "Hakim", "Ziyech");
            _crudMember.CreateMember("00012", "Mason", "Mount");
            _crudMember.CreateMember("00478", "John", "Terry");
            _crudMember.CreateMember("02730", "Kurt", "Zouma");


            _crudSquadMembers.CreateSquadMember("03930", "0102133");
            _crudSquadMembers.CreateSquadMember("01002", "0102133");
            _crudSquadMembers.CreateSquadMember("29390", "0102133");
            _crudSquadMembers.CreateSquadMember("29312", "0102133");
            _crudSquadMembers.CreateSquadMember("29390", "0102133");
            _crudSquadMembers.CreateSquadMember("28199", "3900011");
            _crudSquadMembers.CreateSquadMember("77282", "3900011");
            _crudSquadMembers.CreateSquadMember("00012", "3900011");
            _crudSquadMembers.CreateSquadMember("00478", "3900011");
        }