Esempio n. 1
0
        public void GetNumberOfUsersOnlineTest_should_return_4_user()
        {
            using (var session = RavenDBMembershipProvider.DocumentStore.OpenSession())
            {
                // Arrange
                for (int i = 0; i < 5; i++)
                {
                    var u = CreateUserFake();
                    if (i == 4)
                    {
                        u.IsOnline = false;
                    }
                    u.Username = u.Username + i;
                    session.Store(u);
                }
                session.SaveChanges();

                var config = CreateConfigFake();
                _provider.Initialize(config["applicationName"], config);

                // Act
                int totalOnline = _provider.GetNumberOfUsersOnline();

                // Assert
                Assert.AreEqual(4, totalOnline);
            }
        }