Ejemplo n.º 1
0
        private static async Task <SORPriority> SeedPriority()
        {
            var expectedPriority = new SORPriority
            {
                Description  = "priority",
                PriorityCode = 1
            };
            await InMemoryDb.Instance.SORPriorities.AddAsync(expectedPriority);

            return(expectedPriority);
        }
Ejemplo n.º 2
0
        private static async Task <List <ScheduleOfRates> > SeedSorCodes(
            SORPriority expectedPriority,
            string expectedProperty,
            SorCodeTrade expectedTrade,
            Contract expectedContract = null,
            bool enabled    = true,
            bool isRaisable = true)
        {
            var expectedGenerator = new Generator <ScheduleOfRates>();

            expectedGenerator
            .AddDefaultGenerators()
            .AddValue(expectedPriority, (ScheduleOfRates sor) => sor.Priority)
            .AddValue(expectedProperty, (PropertyContract pc) => pc.PropRef)
            .AddValue(expectedTrade, (ScheduleOfRates sor) => sor.Trade)
            .AddValue(enabled, (ScheduleOfRates sor) => sor.Enabled)
            .AddValue(isRaisable, (ScheduleOfRates sor) => sor.IsRaisable)
            .AddGenerator(() => GenerateJoinEntry(expectedContract), (ScheduleOfRates sor) => sor.SorCodeMap);
            var expectedCodes = expectedGenerator.GenerateList(10);

            await InMemoryDb.Instance.SORCodes.AddRangeAsync(expectedCodes);

            return(expectedCodes);
        }