Esempio n. 1
0
        protected override void SetContextData()
        {
            repo = new ReadingHeadersRepo(testCtx);

            var b = new Faker <ReadingHeaders>()
                    .RuleFor(r => r.ReadingKeyId, f => f.Random.Uuid())
                    .RuleFor(r => r.ServerDateTime, f => new DateTime(f.Random.Long(
                                                                          DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.MeterDateTime, f => new DateTime(f.Random.Long(
                                                                         DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.Readings, f => f.Random.Int())
                    .RuleFor(r => r.ReviewedOn, f => new DateTime(f.Random.Long(
                                                                      DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.IsCgmdata, f => f.Random.Bool())
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.ReadingKeyId, f => f.Random.Uuid());

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

            FakeCollection.AddRange(bs);


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

            var b = new Faker <EmailUsernameView>()
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.UserType, f => 1)
                    .RuleFor(r => r.CreationDate, f => f.Date.Past())
                    .RuleFor(r => r.ClinicianEmail, f => f.Internet.ExampleEmail());

            var c = new Faker <EmailUsernameView>()
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.UserType, f => 2)
                    .RuleFor(r => r.CreationDate, f => f.Date.Past())
                    .RuleFor(r => r.PatientEmail, f => f.Internet.ExampleEmail());

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

            FakeCollection.AddRange(bs);
            FakeCollection.AddRange(bc);

            testCtx.Set <EmailUsernameView>().AddRange(bs);
            testCtx.Set <EmailUsernameView>().AddRange(bc);
            int added = testCtx.SaveChanges();
        }
Esempio n. 3
0
        protected override void SetContextData()
        {
            repo = new UserAuthenticationsRepo(testCtx);

            var b = new Faker <UserAuthentications>()
                    .RuleFor(r => r.ApplicationId, f => f.Random.Uuid())
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.Username, f => f.Lorem.Letter(250))
                    .RuleFor(r => r.Password, f => f.Lorem.Letter(150))
                    .RuleFor(r => r.PasswordFailureCount, f => f.Random.Int())
                    .RuleFor(r => r.LastActivityDate, f => new DateTime(f.Random.Long(
                                                                            DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.LastLockOutDate, f => new DateTime(f.Random.Long(
                                                                           DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.IsApproved, f => f.Random.Bool())
                    .RuleFor(r => r.IsLockedOut, f => f.Random.Bool())
                    .RuleFor(r => r.IsTempPassword, f => f.Random.Bool())
                    .RuleFor(r => r.IsloggedIn, f => f.Random.Bool())
                    .RuleFor(r => r.LastUpdatedByUser, f => f.Random.Uuid());

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

            FakeCollection.AddRange(bs);


            testCtx.UserAuthentications.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
Esempio n. 4
0
        protected override void SetContextData()
        {
            var b = new Faker <AppSettings>()
                    .RuleFor(r => r.AppSettingId, f => f.UniqueIndex)
                    .RuleFor(r => r.Description, f => f.Lorem.Sentence(5))
                    .RuleFor(r => r.LastUpdatedbyUser, f => f.Random.Uuid())
                    .RuleFor(r => r.Name, f => f.Lorem.Word())
                    .RuleFor(r => r.Value, f => f.Lorem.Word());

            var bs = b.Generate(3).OrderBy(o => o.Name).ThenBy(o => o.Value).ToList();

            FakeCollection.AddRange(bs);

            //var apps = Enumerable.Range(1, 3).Select(s => new AppSettings
            //{
            //    ApplicationId = Guid.NewGuid(),
            //    Description = $"Description {s}",
            //    LastUpdatedByUser = Guid.NewGuid(),
            //    Name = $"Name {s}",
            //    Value = $"Value {s}"
            //});

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

            var f = new Faker <Meters>()
                    .RuleFor(r => r.Corporation, v => v.Company.CompanyName())
                    .RuleFor(r => r.CurrentlyActive, v => v.Random.Bool())
                    .RuleFor(r => r.ExternalId, v => v.Lorem.Word())
                    .RuleFor(r => r.InsuletMarket, v => v.Random.Bool())
                    .RuleFor(r => r.MeterClass, v => v.Lorem.Word())
                    .RuleFor(r => r.MeterDelphiIndex, v => v.Random.Int(1, 76))
                    .RuleFor(r => r.MeterDelphiName, v => v.Lorem.Word())
                    .RuleFor(r => r.MeterImageName, v => v.Lorem.Word())
                    .RuleFor(r => r.MeterManufacturer, v => v.Company.CompanyName())
                    .RuleFor(r => r.MeterModel, v => v.Lorem.Word())
                    .RuleFor(r => r.MeterName, v => v.Lorem.Word())
                    .RuleFor(r => r.MeterPid, v => v.Lorem.Word())
                    .RuleFor(r => r.MeterVid, v => v.Lorem.Word());

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

            testCtx.Meters.AddRange(gen);
            FakeCollection.AddRange(gen);
            int added = testCtx.SaveChanges();
        }
Esempio n. 6
0
        protected override void SetContextData()
        {
            repo = new ReadingEventsRepo(testCtx);

            var b = new Faker <ReadingEvents>()
                    .RuleFor(r => r.EventType, f => f.Random.Int())
                    .RuleFor(r => r.EventValue, f => f.Lorem.Letter(150))
                    .RuleFor(r => r.EventTime, f => new DateTime(f.Random.Long(
                                                                     DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.StartTime, f => new DateTime(f.Random.Long(
                                                                     DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.ResumeTime, f => new DateTime(f.Random.Long(
                                                                      DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.StopTime, f => new DateTime(f.Random.Long(
                                                                    DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)))
                    .RuleFor(r => r.ReadingKeyId, f => f.Random.Uuid())
                    .RuleFor(r => r.UserId, f => f.Random.Uuid());

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

            FakeCollection.AddRange(bs);


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

            var f = new Faker <DeviceHostStatusTypes>()
                    .RuleFor(r => r.Status, v => v.PickRandomParam <string>("Started", "Stopped", "Indeterminate"));

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

            testCtx.DeviceHostStatusTypes.AddRange(gen);
            FakeCollection.AddRange(gen);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new LogMessageTypesRepo(testCtx);

            var f = new Faker <LogMessageTypes>()
                    .RuleFor(r => r.TypeName, v => v.PickRandomParam <string>("Informational", "Warning", "Error", "Critical"));

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

            testCtx.LogMessageTypes.AddRange(gen);
            FakeCollection.AddRange(gen);
            int added = testCtx.SaveChanges();
        }
Esempio n. 9
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();
        }
Esempio n. 10
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();
        }
Esempio n. 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();
        }
Esempio n. 12
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();
        }
Esempio n. 13
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 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();
        }
        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();
        }
        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();
        }
        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();
        }
Esempio n. 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();
        }
        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();
        }
Esempio n. 20
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();
        }
Esempio n. 21
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();
        }
        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();
        }
        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();
        }
Esempio n. 25
0
        protected override void SetContextData()
        {
            repo = new AppUserSettingsRepo(testCtx);

            var b = new Faker <AppUserSettings>()
                    .RuleFor(r => r.Name, f => f.Lorem.Paragraph())
                    .RuleFor(r => r.Value, f => f.Lorem.Paragraph())
                    .RuleFor(r => r.AppicationId, f => f.Random.Uuid())
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.LastUpdatedByUser, f => f.Random.Uuid());

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

            testCtx.AppUserSettings.AddRange(bs);
            FakeCollection.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new PatientDevicesRepo(testCtx);

            var b = new Faker <PatientDevices>()
                    .RuleFor(r => r.UserId, f => f.Random.Uuid())
                    .RuleFor(r => r.MeterIndex, f => f.Random.Int())
                    .RuleFor(r => r.Manufacturer, f => f.Lorem.Letter(150));

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

            FakeCollection.AddRange(bs);


            testCtx.PatientDevices.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
Esempio n. 27
0
        protected override void SetContextData()
        {
            repo = new BasalDeliveryDataRepo(testCtx);

            var b = new Faker <BasalDeliveryData>()
                    //.RuleFor(r => r.DataId, f => itrtr32++)
                    .RuleFor(r => r.Name, f => f.Lorem.Random.AlphaNumeric(150))
                    .RuleFor(r => r.Value, f => f.Lorem.Random.AlphaNumeric(150))
                    .RuleFor(r => r.BasalDeliveryId, f => f.Lorem.Random.Int())
                    .RuleFor(r => r.Date, f => DateTime.Now);

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

            testCtx.BasalDeliveryData.AddRange(bs);
            FakeCollection.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
        protected override void SetContextData()
        {
            repo = new CorrectionFactorsRepo(testCtx);

            var b = new Faker <CorrectionFactors>()
                    .RuleFor(r => r.CorrectionFactorValue, f => f.Random.Int())
                    .RuleFor(r => r.Date, f => new DateTime(f.Random.Long(
                                                                DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)));

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

            FakeCollection.AddRange(bs);


            testCtx.CorrectionFactors.AddRange(bs);
            int added = testCtx.SaveChanges();
        }
Esempio n. 29
0
        protected override void SetContextData()
        {
            repo = new DailyTimeSlotsRepo(testCtx);

            var b = new Faker <DailyTimeSlots>()
                    .RuleFor(r => r.TimeSlotBoundary, f => new TimeSpan(f.Random.Long()))
                    .RuleFor(r => r.CareSettingsId, f => f.Random.Int())
                    .RuleFor(r => r.LastUpdatedByUser, f => f.Random.Uuid());

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

            FakeCollection.AddRange(bs);


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

            var b = new Faker <DeviceData>()
                    .RuleFor(r => r.DataSet, f => f.Lorem.Word())
                    .RuleFor(r => r.LastUpdate, f => new DateTime(f.Random.Long(
                                                                      DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks)));

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

            FakeCollection.AddRange(bs);


            testCtx.DeviceData.AddRange(bs);
            int added = testCtx.SaveChanges();
        }