public async Task Build(ITestFixture _) { User = _.Make <User>(m => m.HashedPassword = Hash.Create("123456")); Provider = _.Make <Provider>(m => m.Amounts = "10,20"); await _.Save(User, Provider); _.LoginAs(User); }
public static T MakeSaving <T>(this ITestFixture fixture, Action <T> customizations = null) where T : class { var entity = fixture.Make(customizations); fixture.Save(entity); return(entity); }
public static TUser MakeSavingLogin <TUser>(this ITestFixture fixture, Action <TUser> customizations = null) where TUser : class, IUser { MiruTest.Log.Debug(() => $"Making {typeof(TUser).FullName}"); var user = fixture.Make(customizations); MiruTest.Log.Debug(() => $"Made:{Environment.NewLine}{user.Inspect()}"); return(fixture.MakeSavingLogin(user)); }
public async Task Build(ITestFixture _) { Area1 = _.Make <Area>(); Area2 = _.Make <Area>(); Goal1 = _.Make <Goal>(x => x.Area = Area1); Goal2 = _.Make <Goal>(x => x.Area = Area1); Goal3 = _.Make <Goal>(x => x.Area = Area2); Goal4 = _.Make <Goal>(x => x.Area = Area2); DeletedArea = _.Make <Area>(m => m.IsInactive = true); DeletedGoal = _.Make <Goal>(m => { m.Area = DeletedArea; m.IsInactive = true; }); DeletedGoalArea1 = _.Make <Goal>(m => { m.Area = Area1; m.IsInactive = true; }); // TODO: _.SaveMade() await _.Save(Area1, Area2, Goal1, Goal2, Goal3, Goal4, DeletedArea, DeletedGoal, DeletedGoalArea1); }
public async Task Build(ITestFixture _) { User = _.MakeSavingLogin <User>(); Work = _.Make <Area>(); WorkLess = _.Make <Goal>(m => m.Area = Work); Health = _.Make <Area>(); DrinkWater = _.Make <Goal>(m => m.Area = Health); GoalEdit = _.Make <Goal>(m => m.Area = Health); GoalRemove = _.Make <Goal>(m => m.Area = Health); AreaToRemove = _.Make <Area>(); GoalAreaToRemove = _.Make <Goal>(m => m.Area = AreaToRemove); AreaToEdit = _.Make <Area>(); await _.Save( Work, WorkLess, Health, DrinkWater, GoalEdit, GoalRemove, AreaToRemove, GoalAreaToRemove, AreaToEdit); }