Exemple #1
0
        public Program()
        {
            _locker = new object();
            _cancellationTokenSource = new CancellationTokenSource();

            Console.WriteLine("Введите пароль пользователя postgres: ");
            string pass = Console.ReadLine();

            Console.Clear();
            ConnectionString  = $"Host=localhost;Port=5432;Database=NormalizedStudents;Username=postgres;Password={pass};";
            _graduatesService = new StudentsServiceProvider(ConnectionString);
        }
        public void Setup()
        {
            // TODO: code which will be executed before each test!

            _mockUnitOfWork = new MockUnitOfWork <MockDataContext>();
            _dataFactory    = new MockDataFactory();

            // Setting up mock repos to be used
            _mockUnitOfWork.SetRepositoryData(_dataFactory.GetMockRepo <Person>());

            // Creating the service using the new mock UOW
            _service = new StudentsServiceProvider(_mockUnitOfWork);
        }
 /// <summary>
 /// Default constructor
 /// </summary>
 public StudentsController()
 {
     _studentService = new StudentsServiceProvider(new UnitOfWork <AppDataContext>());
 }