public void SaveUser() { //given var me = SeedData.CreateAdminUser(Context); ISecurityProvider provider = new SecurityProvider(Context, me); var privileges = SeedData.GetPrivileges(Context); var roles = SeedData.GetRoles(Context); var createRole = provider.SaveRole(null, "Tester", "Write and manage Unit Tests", privileges); var newSignUp = provider.SignUp("Martian", "loyal007", "*****@*****.**", "Mr", "James", "Bond", "01111111110", GenderType.Male, "+440000000", "123 Old Trafford", "UK", "Manchester", "0000"); //when var u = provider.GetUser(newSignUp.Id); var saveUser = provider.SaveUser(null, u.UserName, u.PasswordHash, u.EmailAddress, u.Title, u.FirstName, u.Surname, u.IdPassportNum, u.Gender, u.Telephone, u.AddressLine1, u.AddressLine2, u.City, u.PostalCode, roles, true); //then saveUser.UserName.ShouldEqual("Martian"); saveUser.AddressLine2.ShouldEqual("UK"); saveUser.Gender.ShouldEqual(GenderType.Male); }
public void GetUser() { //given var me = SeedData.CreateAdminUser(Context, "David"); ISecurityProvider provider = new SecurityProvider(Context, me); //when var getUser = provider.GetUser(me.Id); //then getUser.Id.ShouldBeGreaterThan(0); getUser.UserName.ShouldEqual("David"); }