예제 #1
0
        public void GetSingleReadingHeaders()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.ReadingKeyId);

            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
            Assert.AreEqual(fakeApp.ServerDateTime, single.ServerDateTime);
            Assert.AreEqual(fakeApp.MeterDateTime, single.MeterDateTime);
            Assert.AreEqual(fakeApp.Readings, single.Readings);
            Assert.AreEqual(fakeApp.ReviewedOn, single.ReviewedOn);
            Assert.AreEqual(fakeApp.IsCgmdata, single.IsCgmdata);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
        }
예제 #2
0
        protected override void SetContextData()
        {
            repo = new DataShareCategoriesRepo(testCtx);

            var b = new Faker <DataShareCategories>()
                    .RuleFor(r => r.CategoryName, f => f.Lorem.Letter(150));

            var bs = b.Generate(3).OrderBy(o => o.CategoryId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.DataShareCategories.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        public void GetSingleNutritionReadings()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.ReadingId);

            Assert.AreEqual(fakeApp.ReadingId, single.ReadingId);
            Assert.AreEqual(fakeApp.Carbohydrates, single.Carbohydrates);
            Assert.AreEqual(fakeApp.Calories, single.Calories);
            Assert.AreEqual(fakeApp.Protien, single.Protien);
            Assert.AreEqual(fakeApp.Fat, single.Fat);
            Assert.AreEqual(fakeApp.ReadingDateTime, single.ReadingDateTime);
            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
        }
        public void UpdateType()
        {
            var fk = FakeCollection.First();

            fk.ApplicationName = "Mighty Lion";

            repo.Update(fk);
            repo.Save();

            var entity = testCtx.Applications.First(f => f.ApplicationName == "Mighty Lion");

            Assert.AreEqual(fk.ApplicationId, entity.ApplicationId);
            Assert.AreEqual(fk.ApplicationName, entity.ApplicationName);
        }
예제 #5
0
        protected override void SetContextData()
        {
            repo = new PumpProgramTypesRepo(testCtx);

            var b = new Faker <PumpProgramTypes>()
                    .RuleFor(r => r.Name, f => f.Lorem.Letter(50));

            var bs = b.Generate(3).ToList();

            FakeCollection.AddRange(bs);

            testCtx.PumpProgramTypes.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
예제 #6
0
        public void GetSinglePumps()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.PumpKeyId);

            Assert.AreEqual(fakeApp.PumpKeyId, single.PumpKeyId);
            Assert.AreEqual(fakeApp.PumpName, single.PumpName);
            Assert.AreEqual(fakeApp.PumpStartDate, single.PumpStartDate);
            Assert.AreEqual(fakeApp.ActiveProgramId, single.ActiveProgramId);
            Assert.AreEqual(fakeApp.Cannula, single.Cannula);
            Assert.AreEqual(fakeApp.ReplacementDate, single.ReplacementDate);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.PumpKeyId, single.PumpKeyId);
        }
        protected override void SetContextData()
        {
            repo = new CheckStatusRepo(testCtx);

            var b = new Faker <CheckStatus>()
                    .RuleFor(r => r.Status, f => f.Lorem.Letter(50));

            var bs = b.Generate(3).OrderBy(o => o.StatusId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.CheckStatus.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
예제 #8
0
        public void GetSinglePatientAddresses()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.AddressId);

            Assert.AreEqual(fakeApp.AddressId, single.AddressId);
            Assert.AreEqual(fakeApp.Street1, single.Street1);
            Assert.AreEqual(fakeApp.City, single.City);
            Assert.AreEqual(fakeApp.State, single.State);
            Assert.AreEqual(fakeApp.Zip, single.Zip);
            Assert.AreEqual(fakeApp.Country, single.Country);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.LastUpdatedByUser, single.LastUpdatedByUser);
        }
예제 #9
0
        public void GetSingleDiabetesManagementData()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.DmdataId);

            Assert.AreEqual(fakeApp.DmdataId, single.DmdataId);
            Assert.AreEqual(fakeApp.LowBglevel, single.LowBglevel);
            Assert.AreEqual(fakeApp.HighBglevel, single.HighBglevel);
            Assert.AreEqual(fakeApp.PremealTarget, single.PremealTarget);
            Assert.AreEqual(fakeApp.PostmealTarget, single.PostmealTarget);
            Assert.AreEqual(fakeApp.ModifiedDate, single.ModifiedDate);
            Assert.AreEqual(fakeApp.ModifiedUserId, single.ModifiedUserId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
        }
        public void GetSinglePayPal()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.PayPalId);

            Assert.AreEqual(fakeApp.PayPalId, single.PayPalId);
            Assert.AreEqual(fakeApp.TxnId, single.TxnId);
            Assert.AreEqual(fakeApp.PaymentDate, single.PaymentDate);
            Assert.AreEqual(fakeApp.McGross, single.McGross);
            Assert.AreEqual(fakeApp.McFee, single.McFee);
            Assert.AreEqual(fakeApp.PayPalPostVars, single.PayPalPostVars);
            Assert.AreEqual(fakeApp.SourceIp, single.SourceIp);
            Assert.AreEqual(fakeApp.PaymentId, single.PaymentId);
        }
예제 #11
0
        protected override void SetContextData()
        {
            repo = new ReadingEventTypesRepo(testCtx);

            var b = new Faker <ReadingEventTypes>()
                    .RuleFor(r => r.EventName, f => f.Lorem.Letter(150));

            var bs = b.Generate(3).OrderBy(o => o.EventId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.ReadingEventTypes.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new DeviceHostMessagesRepo(testCtx);

            var f = new Faker <DeviceHostMessages>()
                    .RuleFor(r => r.Message, v => v.Lorem.Sentence())
                    .RuleFor(r => r.LastUpdated, v => v.Date.Past());

            var gen = f.Generate(3).OrderBy(o => o.MessageId).ToList();

            testCtx.DeviceHostMessages.AddRange(gen);
            FakeCollection.AddRange(gen);
            int added = testCtx.SaveChanges();
        }
예제 #13
0
        protected override void SetContextData()
        {
            repo = new InsulinTypesRepo(testCtx);

            var b = new Faker <InsulinTypes>()
                    .RuleFor(r => r.Type, f => f.Lorem.Letter(50));

            var bs = b.Generate(3).OrderBy(o => o.InsulinTypeId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.InsulinTypes.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        public void GetSingleTensReadings()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.ReadingId);

            Assert.AreEqual(fakeApp.ReadingId, single.ReadingId);
            Assert.AreEqual(fakeApp.ReadingDate, single.ReadingDate);
            Assert.AreEqual(fakeApp.TherapyType, single.TherapyType);
            Assert.AreEqual(fakeApp.DurationScheduled, single.DurationScheduled);
            Assert.AreEqual(fakeApp.DurationCompleted, single.DurationCompleted);
            //Assert.AreEqual(fakeApp.Intensity, single.Intensity);
            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
        }
예제 #15
0
        protected override void SetContextData()
        {
            repo = new DatabaseInfoRepo(testCtx);

            var b = new Faker <DatabaseInfo>()
                    .RuleFor(r => r.SiteId, f => f.Random.Int());

            var bs = b.Generate(3).OrderBy(o => o.Id).ToList();

            FakeCollection.AddRange(bs);

            testCtx.DatabaseInfo.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new BolusCarbsRepo(testCtx);

            var b = new Faker <BolusCarbs>()
                    .RuleFor(r => r.CarbValue, f => f.Random.Int())
                    .RuleFor(r => r.Date, f => DateTime.Now);

            var bs = b.Generate(3).OrderBy(o => o.CarbId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.BolusCarbs.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new AssignedUserTypesRepo(testCtx);

            var b = new Faker <AssignedUserTypes>()
                    .RuleFor(r => r.UserType, f => f.PickRandom <int>(1, 2, 3))
                    .RuleFor(r => r.UserId, f => f.Random.Uuid());

            var bs = b.Generate(3).ToList();

            FakeCollection.AddRange(bs);

            testCtx.AssignedUserTypes.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
예제 #18
0
        protected override void SetContextData()
        {
            repo = new PaymentMethodRepo(testCtx);

            var b = new Faker <PaymentMethod>()
                    .RuleFor(r => r.MethodName, f => f.Lorem.Letter(50));

            var bs = b.Generate(3).OrderBy(o => o.MethodId).ToList();

            FakeCollection.AddRange(bs);


            testCtx.PaymentMethod.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
예제 #19
0
        public void GetSingleReadingEvents()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.Eventid);

            Assert.AreEqual(fakeApp.Eventid, single.Eventid);
            Assert.AreEqual(fakeApp.EventType, single.EventType);
            Assert.AreEqual(fakeApp.EventValue, single.EventValue);
            Assert.AreEqual(fakeApp.EventTime, single.EventTime);
            Assert.AreEqual(fakeApp.StartTime, single.StartTime);
            Assert.AreEqual(fakeApp.ResumeTime, single.ResumeTime);
            Assert.AreEqual(fakeApp.StopTime, single.StopTime);
            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
        }
        public void GetSingleTotalDailyInsulinDeliveries()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.DeliveryId);

            Assert.AreEqual(fakeApp.DeliveryId, single.DeliveryId);
            Assert.AreEqual(fakeApp.TotalDelivered, single.TotalDelivered);
            Assert.AreEqual(fakeApp.BasalDelivered, single.BasalDelivered);
            Assert.AreEqual(fakeApp.TempActivated, single.TempActivated);
            Assert.AreEqual(fakeApp.Valid, single.Valid);
            Assert.AreEqual(fakeApp.BolusDelivered, single.BolusDelivered);
            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.Date, single.Date);
        }
        protected override void SetContextData()
        {
            repo = new InstructionItemsRepo(testCtx);

            var f = new Faker <InstructionItems>()
                    .RuleFor(r => r.Instruction, v => v.Lorem.Sentence())
                    .RuleFor(r => r.MeterId, v => v.Random.Int(1, 76))
                    .RuleFor(r => r.StepNumber, v => v.Random.Int(1, 4));

            var gen = f.Generate(3).OrderBy(o => o.Id).ToList();

            testCtx.InstructionItems.AddRange(gen);
            FakeCollection.AddRange(gen);
            int added = testCtx.SaveChanges();
        }
예제 #22
0
        protected override void SetContextData()
        {
            repo = new PatientPhotosRepo(testCtx);

            var b = new Faker <PatientPhotos>()
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.Photo, f => f.Random.Bytes(5));

            var bs = b.Generate(3).OrderBy(o => o.UserId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.PatientPhotos.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
예제 #23
0
        public void GetSinglePatients()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.UserId);

            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.Firstname, single.Firstname);
            Assert.AreEqual(fakeApp.Lastname, single.Lastname);
            Assert.AreEqual(fakeApp.Gender, single.Gender);
            Assert.AreEqual(fakeApp.DateofBirth, single.DateofBirth);
            Assert.AreEqual(fakeApp.PlanId, single.PlanId);
            Assert.AreEqual(fakeApp.Email, single.Email);
            Assert.AreEqual(fakeApp.InstitutionId, single.InstitutionId);
            Assert.AreEqual(fakeApp.LastUpdatedByUser, single.LastUpdatedByUser);
        }
예제 #24
0
        protected override void SetContextData()
        {
            repo = new SharedAreasRepo(testCtx);

            var b = new Faker <SharedAreas>()
                    .RuleFor(r => r.DataShareCategoryId, f => f.Random.Int())
                    .RuleFor(r => r.RequestId, f => f.Random.Int());

            var bs = b.Generate(3).OrderBy(o => o.DataShareCategoryId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.SharedAreas.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        public void GetSingleSubscriptions()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.SubscriptionId);

            Assert.AreEqual(fakeApp.SubscriptionId, single.SubscriptionId);
            Assert.AreEqual(fakeApp.ApplicationId, single.ApplicationId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.UserType, single.UserType);
            Assert.AreEqual(fakeApp.SubscriptionType, single.SubscriptionType);
            Assert.AreEqual(fakeApp.SubscriptionDate, single.SubscriptionDate);
            Assert.AreEqual(fakeApp.ExpirationDate, single.ExpirationDate);
            Assert.AreEqual(fakeApp.IsTrial, single.IsTrial);
            Assert.AreEqual(fakeApp.InstitutionId, single.InstitutionId);
        }
        protected override void SetContextData()
        {
            repo = new SubscriptionTypeRepo(testCtx);

            var b = new Faker <SubscriptionType>()
                    .RuleFor(r => r.ApplicationId, f => f.Random.Uuid())
                    .RuleFor(r => r.SubscriptionLengthDays, f => f.Random.Int())
                    .RuleFor(r => r.Price, f => f.Random.Decimal());

            var bs = b.Generate(3).OrderBy(o => o.SubscriptionTypeId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.SubscriptionType.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new BGTargetsRepo(testCtx);

            var b = new Faker <Bgtargets>()
                    .RuleFor(r => r.TargetBg, f => f.Random.Int())
                    .RuleFor(r => r.TargetBgcorrect, f => f.Random.Int())
                    .RuleFor(r => r.Date, f => DateTime.Now);

            var bs = b.Generate(3).OrderBy(o => o.TargetId).ToList();

            FakeCollection.AddRange(bs);

            testCtx.Bgtargets.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        public void GetSinglePhysiologicalReadings()
        {
            var fakeApp = FakeCollection.First();
            var single  = repo.GetSingle(fakeApp.ReadingId);

            Assert.AreEqual(fakeApp.ReadingId, single.ReadingId);
            Assert.AreEqual(fakeApp.Time, single.Time);
            Assert.AreEqual(fakeApp.Weight, single.Weight);
            //Assert.AreEqual(fakeApp.Height, single.Height);
            Assert.AreEqual(fakeApp.Hunger, single.Hunger);
            Assert.AreEqual(fakeApp.Nausea, single.Nausea);
            Assert.AreEqual(fakeApp.CaloriesBurned, single.CaloriesBurned);
            Assert.AreEqual(fakeApp.CaloriesConsumed, single.CaloriesConsumed);
            Assert.AreEqual(fakeApp.ReadingKeyId, single.ReadingKeyId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
        }
        public void GetSinglePatientListView()
        {
            var fakeApp = FakeCollection.First();
            var single  = testCtx.Set <PatientListView>().FirstOrDefault(f => f.UserId == fakeApp.UserId);

            Assert.AreEqual(fakeApp.InstitutionId, single.InstitutionId);
            Assert.AreEqual(fakeApp.UserId, single.UserId);
            Assert.AreEqual(fakeApp.Username, single.Username);
            Assert.AreEqual(fakeApp.InstitutionName, single.InstitutionName);
            Assert.AreEqual(fakeApp.Firstname, single.Firstname);
            Assert.AreEqual(fakeApp.Lastname, single.Lastname);
            Assert.AreEqual(fakeApp.Middlename, single.Middlename);
            Assert.AreEqual(fakeApp.Email, single.Email);
            Assert.AreEqual(fakeApp.DateofBirth, single.DateofBirth);
            Assert.AreEqual(fakeApp.MRID, single.MRID);
        }
        protected override void SetContextData()
        {
            repo = new NuMedicsUserPrintSettingsRepo(testCtx);

            var p = new Faker <NuMedicsUserPrintSettings>()
                    .RuleFor(r => r.SettingsApplyToUser, v => v.Random.Uuid())
                    .RuleFor(r => r.UserId, v => v.Random.Uuid())
                    .RuleFor(r => r.JsonPrintSettings, v => v.Lorem.Paragraphs(6));

            var ps = p.Generate(3).OrderBy(o => o.PrintSettingId).ToList();

            FakeCollection.AddRange(ps);

            testCtx.NuMedicsUserPrintSettings.AddRange(ps);
            int added = testCtx.SaveChanges();
        }