Ejemplo n.º 1
0
        public void TestAddOpenSessionEvent()
        {
            ShardImpl shard = new ShardImpl(new ShardId(1), Stub <ISessionFactoryImplementor>()); //new SessionFactoryDefaultMock()

            try
            {
                shard.AddOpenSessionEvent(null);
                Assert.Fail("expected nre");
            }
            catch (NullReferenceException nre)
            {
                // good
            }
            IOpenSessionEvent ose = Stub <IOpenSessionEvent>(); //new OpenSessionEventDefaultMock()

            shard.AddOpenSessionEvent(ose);
            Assert.IsNotNull(shard.GetOpenSessionEvents());
            Assert.AreEqual(1, shard.GetOpenSessionEvents().Count);  //.size()
            //Assert.AreSame(ose, shard.GetOpenSessionEvents().Find(0));//.get(0)

            // now add another and make sure it is added to the end
            IOpenSessionEvent anotherOse = Stub <IOpenSessionEvent>();

            shard.AddOpenSessionEvent(anotherOse);
            Assert.IsNotNull(shard.GetOpenSessionEvents());
            Assert.AreEqual(2, shard.GetOpenSessionEvents().Count);  //.size()
            //Assert.AreSame(ose, shard.GetOpenSessionEvents().get(0));
            //Assert.AreSame(anotherOse, shard.GetOpenSessionEvents().get(1));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add a open Session event 
 /// </summary>
 /// <param name="event">the event to add</param>
 public void AddOpenSessionEvent(IOpenSessionEvent @event)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Add a open Session event
 /// </summary>
 /// <param name="event">the event to add</param>
 public void AddOpenSessionEvent(IOpenSessionEvent @event)
 {
     Preconditions.CheckNotNull(@event);
     openSessionEvents.AddLast(@event);
 }