Ejemplo n.º 1
0
        public void RoleExists()
        {
            var newRole = _testRoles[0];

            newRole.ApplicationName = _appName;

            using (var store = NewInMemoryStore())
            {
                using (var session = store.OpenSession())
                {
                    session.Store(newRole);
                    session.SaveChanges();
                }

                Thread.Sleep(500);

                var provider = new RavenDBRoleProvider();
                RavenDBRoleProvider.DocumentStore = store;
                provider.ApplicationName          = _appName;
                Assert.True(provider.RoleExists(_testRoles[0].Name));
            }
        }
Ejemplo n.º 2
0
        public void RoleExists()
        {
            var appName = "APPNAME";
            var newRole = new Role("TheRole", null);

            newRole.ApplicationName = appName;

            using (var store = NewInMemoryStore())
            {
                using (var session = store.OpenSession())
                {
                    session.Store(newRole);
                    session.SaveChanges();
                }

                Thread.Sleep(500);

                var provider = new RavenDBRoleProvider();
                provider.DocumentStore   = store;
                provider.ApplicationName = appName;
                Assert.True(provider.RoleExists("TheRole"));
            }
        }