Exemplo n.º 1
0
        public static T MakeSaving <T>(this ITestFixture fixture, Action <T> customizations = null) where T : class
        {
            var entity = fixture.Make(customizations);

            fixture.SaveSync(entity);

            return(entity);
        }
Exemplo n.º 2
0
        public static TUser MakeSavingLogin <TUser>(this ITestFixture fixture, TUser user) where TUser : class, IUser
        {
            MiruTest.Log.Debug(() => $"Saving: {user}");

            fixture.SaveSync(user);

            fixture.LoginAs(user);

            return(user);
        }
Exemplo n.º 3
0
        public static IEnumerable <T> MakeManySaving <T>(this ITestFixture fixture, int howMany = 3, Action <T> customizations = null) where T : class
        {
            MiruTest.Log.Information($"Making and saving {howMany} {typeof(T).FullName}");

            var entities = fixture.Get <Fabricator>().MakeMany(howMany, customizations);

            MiruTest.Log.Debug(() => $"Made:{Environment.NewLine}{entities.Inspect()}");

            MiruTest.Log.Debug(() => $"Saving the {howMany} entities");

            fixture.SaveSync(entities);

            return(entities);
        }