Exemplo n.º 1
0
        public void LogDatabase_Transactions_Can_Commit_Operations_To_Database()
        {
            _LogDatabase.PerformInTransaction(() => {
                _LogDatabase.EstablishSession("88.77.66.55", null);
                return(true);
            });

            var clients     = new List <LogClient>();
            var sessionsMap = new Dictionary <long, IList <LogSession> >();

            _LogDatabase.FetchAll(clients, sessionsMap);

            Assert.AreEqual(1, clients.Count);
            var client = clients[0];

            Assert.AreEqual("88.77.66.55", client.IpAddress);
            Assert.AreNotEqual(0, client.Id);
            Assert.AreEqual(1, sessionsMap.Values.Count);
        }