Inheritance: IUserProvider
Example #1
0
        public void ManagerSetup()
        {
            this.provider = new MockConnectionProvider(GablarskiProtocol.Instance);
            this.provider.Start(MessageTypes.All);

            var connections = this.provider.GetConnections(GablarskiProtocol.Instance);

            this.server = new ConnectionBuffer(connections.Item2);
            this.client = connections.Item1;

            userProvider = new MockUserProvider();
            context      = new MockClientContext(client)
            {
                ServerInfo = new ServerInfo(new ServerSettings(), userProvider)
            };

            var channels = new ClientChannelManager(context);

            ClientChannelManagerTests.PopulateChannels(channels, this.server);

            this.userManager = new ClientUserManager();
            this.handler     = new ClientUserHandler(context, userManager);
            context.Users    = this.handler;
            context.Channels = channels;
        }
        public void Setup()
        {
            permissions = new MockPermissionsProvider();
            users       = new MockUserProvider();

            provider = new MockConnectionProvider(GablarskiProtocol.Instance);

            context = new MockServerContext(provider)
            {
                Settings            = new ServerSettings(),
                UserProvider        = users,
                PermissionsProvider = permissions,
                ChannelsProvider    = new LobbyChannelProvider(),
            };

            context.Sources     = new ServerSourceHandler(context, new ServerSourceManager(context));
            context.Channels    = new ServerChannelHandler(context);
            context.UserManager = new ServerUserManager();
            context.Users       = handler = new ServerUserHandler(context, context.UserManager);

            context.Start();

            var cs = provider.GetConnections(GablarskiProtocol.Instance);

            server = new ServerConnectionBuffer(cs.Item2);
            client = new ConnectionBuffer(cs.Item1);

            var observers = provider.GetConnections(GablarskiProtocol.Instance);

            sobserver = observers.Item2;
            observer  = new ConnectionBuffer(observers.Item1);
        }
		public void Setup()
		{
			permissions = new MockPermissionsProvider();
			users = new MockUserProvider();

			provider = new MockConnectionProvider (GablarskiProtocol.Instance);

			context = new MockServerContext (provider)
			{
				Settings = new ServerSettings(),
				UserProvider = users,
				PermissionsProvider = permissions,
				ChannelsProvider = new LobbyChannelProvider(),
			};

			context.Sources = new ServerSourceHandler (context, new ServerSourceManager (context));
			context.Channels = new ServerChannelHandler (context);
			context.UserManager = new ServerUserManager();
			context.Users = handler = new ServerUserHandler (context, context.UserManager);

			context.Start();

			var cs = provider.GetConnections (GablarskiProtocol.Instance);
			server = new ServerConnectionBuffer (cs.Item2);
			client = new ConnectionBuffer (cs.Item1);

			var observers = provider.GetConnections (GablarskiProtocol.Instance);
			sobserver = observers.Item2;
			observer = new ConnectionBuffer (observers.Item1);
		}
 public void ManagerTearDown()
 {
     this.userProvider = null;
     this.server = null;
     this.handler = null;
     this.userManager = null;
     this.provider = null;
     this.context = null;
 }
        public void ManagerSetup()
        {
            this.provider = new MockConnectionProvider (GablarskiProtocol.Instance);
            this.provider.Start (MessageTypes.All);

            var connections = this.provider.GetConnections (GablarskiProtocol.Instance);

            this.server = new ConnectionBuffer (connections.Item2);
            this.client = connections.Item1;

            userProvider = new MockUserProvider();
            context = new MockClientContext (client) { ServerInfo = new ServerInfo (new ServerSettings(), userProvider) };

            var channels = new ClientChannelManager (context);
            ClientChannelManagerTests.PopulateChannels (channels, this.server);

            this.userManager = new ClientUserManager();
            this.handler = new ClientUserHandler (context, userManager);
            context.Users = this.handler;
            context.Channels = channels;
        }