public static async Task <TResult> ShouldAuthorize <TResult, TUser>( this ITestFixture fixture, TUser user, IRequest <TResult> message) where TUser : UserfyUser { fixture.LoginAs(user); return(await fixture.App.SendAsync(message)); }
public static async Task ShouldNotAuthorize <TResult, TUser>( this ITestFixture fixture, TUser user, IRequest <TResult> message) where TUser : UserfyUser { fixture.LoginAs(user); await Should.ThrowAsync <UnauthorizedException>(async() => await fixture.App.SendAsync(message)); }
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 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); }