コード例 #1
0
        public void DeleteMessageByAdmin_MessageRemove()
        {
            StubUser admin = new StubUser(Guid.NewGuid());

            StubUser[] admins = new StubUser[] { admin };
            StubUser   user   = new StubUser(Guid.NewGuid());

            StubUser[] users = new StubUser[] { user };
            GroupChat  chat  = new GroupChat(
                Guid.NewGuid(),
                new List <Message>(),
                new List <IUser>(users),
                new List <IUser>(admins));
            Message message = new Message(Guid.NewGuid(), admin, "hello");

            chat.DeleteMessage(message.Id, admin);

            foreach (Message mes in chat.Messages)
            {
                Assert.IsFalse(mes.Equals(message));
            }
        }