Esempio n. 1
0
        public void ConcreteProfileWorking()
        {
            var dataset = Database.Setup();

            using (var db = Database.Use(dataset))
            {
                var controller = new Seterator.Controllers.Api.ProfileController(db);
                var roleGuid   = db.Roles.First().Guid;
                var result     = controller.GetProfiles(new ProfileRequest()
                {
                    Guid = roleGuid,
                    Type = ProfileRequest.ProfileRequestType.concrete
                });
                Assert.IsType <OkObjectResult>(result);
                Assert.IsType <UserProfile>((result as OkObjectResult).Value);
                Assert.NotNull((result as OkObjectResult).Value);
            }
        }
Esempio n. 2
0
        public void ListProfilesWorking()
        {
            var dataset = Database.Setup();

            using (var db = Database.Use(dataset))
            {
                var controller = new Seterator.Controllers.Api.ProfileController(db);
                var userGuid   = db.Users.First().Guid;
                var result     = controller.GetProfiles(new ProfileRequest()
                {
                    Guid = userGuid,
                    Type = ProfileRequest.ProfileRequestType.list
                });
                Assert.IsType <OkObjectResult>(result);
                var okResult = result as OkObjectResult;
                var profiles = okResult.Value as IEnumerable <UserProfile>;
                Assert.All(profiles, (profile) =>
                {
                    Assert.IsType <UserProfile>(profile);
                    Assert.NotNull(profile);
                });
            }
        }