public void GetAllMedicalTests()
        {
            // Arrange
            var repo = new MedicalTestsRepository();

            // Act
            var result = repo.GetAllMedicalTests();

            // Assert
            Assert.Equal(3, result.Count);
        }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var repository = new AppointmentsRepository();

            services.AddSingleton <IAppointmentsRepository>(repository);

            var repository2 = new MedicalTestsRepository();

            services.AddSingleton <IMedicalTestsRepository>(repository2);

            services.AddControllersWithViews();
        }
        public void DeleteMedicalTests()
        {
            // Arrange
            var repo         = new MedicalTestsRepository();
            var medicalTests = new MedicalTests();

            // Act
            repo.DeleteMedicalTests(medicalTests);
            var result = repo.GetAllMedicalTests();

            // Assert
            Assert.Equal(3, result.Count);
        }
        public void CreateMedicalTests()
        {
            // Arrange
            var repo         = new MedicalTestsRepository();
            var medicalTests = new MedicalTests()
            {
                Id              = Guid.NewGuid(),
                Name            = "Name Test",
                Phone           = 0735549508,
                TestName        = TestName.CompleteBloodCount,
                Date            = DateTime.Now,
                TestedComponent = "Platelets",
                NormalValues    = "150,000 to 450,000/mcL",
                ResultedValues  = "350,000/mcL",
                Diagnosis       = "Healthy",
            };

            // Act
            repo.CreateMedicalTests(medicalTests);
            var result = repo.GetAllMedicalTests();

            // Assert
            Assert.Equal(4, result.Count);
        }