Пример #1
0
 public void Run()
 {
     Developers = new DeveloperRepo();
     DevTeams   = new DevTeamRepo();
     SeedData();
     MainMenu();
 }
        public void Arrange()
        {
            _repo      = new DeveloperRepo();
            _developer = new Developer("Elon Musk", 21716, false);

            _repo.AddDeveloperToList(_developer);
        }
Пример #3
0
        public void TestForAddingPOCOToListTwo()
        {
            //Arrange - Setting up the controlled environment for our test
            DeveloperRepo devRepo  = new DeveloperRepo();
            Developer     devToAdd = new Developer("TestDev", true);

            //Act - Calling the code that we are testing
            devRepo.AddDeveloperToDirectory(devToAdd);

            //Assert - Utilizing the Assert class to confirm the validity of our tests

            Developer        copyOfDevFromList = new Developer();
            List <Developer> devDirectory      = devRepo.GetAllDevelopers();

            foreach (Developer dev in devDirectory)
            {
                if (dev.DeveloperID == devToAdd.DeveloperID)
                {
                    copyOfDevFromList = dev;
                    break;
                }
            }

            Assert.AreEqual(devToAdd.Name, copyOfDevFromList.Name);
        }
Пример #4
0
        public void TestForAddingPocoToList() //Our Poco is our Developer, The List is the _developerDirectory from our DeveloperRepo object.
        {
            // Arrange - Set up the data or controlled environment for the test to run
            DeveloperRepo devRepo  = new DeveloperRepo();
            Developer     devToAdd = new Developer("TestDev", true);

            //Act - we can now call the Method that we are testing
            devRepo.AddDeveloperToDirectory(devToAdd);

            //Assert - We've ran the method, and we write few lines of code to confirm that our method behaved the way that we intended it to behave

            List <Developer> devDirectory = devRepo.GetAllDevelopers();

            bool IdIsEqual = false; //We assume it is false until proved true

            foreach (Developer dev in devDirectory)
            {
                if (dev.DeveloperID == devToAdd.DeveloperID)
                {
                    IdIsEqual = true;
                    break;
                }
            }

            //Assert
            Assert.IsTrue(IdIsEqual);
        }
 public void Arrange()
 {
     _developer = new Developer(new List <Courses>()
     {
         Courses.MusicHistory, Courses.CalculusI
     }, STARTING_BALANCE);
     _developerRepo = new DeveloperRepo();
 }
Пример #6
0
        private async Task <List <Account> > GetUsers()
        {
            var userList = new List <Account>();

            userList.AddRange(await AdminRepo.GetAllItemsAsync());
            userList.AddRange(await DeveloperRepo.GetAllItemsAsync());
            userList.AddRange(await RecruiterRepo.GetAllItemsAsync());
            return(userList);
        }
Пример #7
0
        public UserUnitOfWork(ApplicationContext db)
        {
            _db = db;

            UserManager = new ApplicationUserManager(new UserStore <ApplicationUser>(_db));
            RoleManager = new ApplicationRoleManager(new RoleStore <ApplicationRole>(_db));

            Managers     = new ManagerRepo(_db);
            Developers   = new DeveloperRepo(_db);
            SkillRatings = new SkillRatingRepo(_db);
        }
Пример #8
0
        public void TestForGetDeveloperDirectoryIsNotNull()
        {
            //Arrange
            DeveloperRepo devRepo = new DeveloperRepo();

            //Act
            List <Developer> listFromRepo = devRepo.GetAllDevelopers();

            //Assert
            Assert.IsNotNull(listFromRepo);
        }
        public void AddToList_ShouldGetNotNull()
        {
            Developer developer = new Developer();

            developer.Name = "Elon Musk";
            DeveloperRepo repository = new DeveloperRepo();

            repository.AddDeveloperToList(developer);
            Developer contentFromDirectory = repository.GetDeveloperByName("Elon Musk");

            Assert.IsNotNull(contentFromDirectory);
        }
Пример #10
0
        public void TestForGetDevByID2()
        {
            DeveloperRepo devRepo  = new DeveloperRepo();
            Developer     devToAdd = new Developer("TestDev", true);

            devRepo.AddDeveloperToDirectory(devToAdd);

            //Act
            Developer devByID = devRepo.GetDeveloperById(devToAdd.DeveloperID);

            bool devIDsAreEqual = devToAdd.Name == devByID.Name;

            Assert.IsTrue(devIDsAreEqual);
        }
Пример #11
0
        public void TestForGetDevByID()
        {
            //Arange
            DeveloperRepo devRepo  = new DeveloperRepo();
            Developer     devToAdd = new Developer("TestDev", true);

            devRepo.AddDeveloperToDirectory(devToAdd);

            //Act
            Developer devByID = devRepo.GetDeveloperById(devToAdd.DeveloperID);

            //Assert
            Assert.AreEqual(devToAdd, devByID);
        }
        // creat new DeveloperRepo
        private void CreatNewTeam()
        {
            DeveloperRepo newTeam = new DeveloperRepo();

            // Description
            Console.WriteLine("Enter the description for the Team:");

            //Maturity Rating

            //Star Rating

            //IsFamilyFriendly

            //GenreType
        }
Пример #13
0
 private async Task GetUsers()
 {
     AllUsers = new List <User>();
     AllUsers.AddRange(await DeveloperRepo.GetAllItemsAsync());
     AllUsers.AddRange(await RecruiterRepo.GetAllItemsAsync());
 }
Пример #14
0
 public void Setup()
 {
     repo = new DeveloperRepo();
 }
Пример #15
0
 public DevTeamRepo(DeveloperRepo d)
 {
     devRepo = d;
 }
Пример #16
0
 private async void GetUserData()
 {
     DevelopersResult = await DeveloperRepo.GetAllItemsAsync();
 }