コード例 #1
0
        public void SuccessfulCreationOfChatMessageWithGenericRepositoryCreate()
        {
            string messageTest = Guid.NewGuid().ToString();
            var chatReferences = PreparePoem<LegendAuthorityType, HaikuPoem>();
            UserProfile author = chatReferences.Item1;
            Poem poem = chatReferences.Item2;

            var chatMessage = new ChatMessage
            {
                Message = messageTest,
                WrittenAt = DateTime.UtcNow,
                WrittenByProfileId = author.Id,
                PoemId = poem.Id
            };
            RegisterDataStoreObject(chatMessage);

            Assert.IsNotNull(chatMessage);
            AssertChatMessageIdIsIncremented(chatMessage);
        }
コード例 #2
0
 private void AssertChatMessageIdIsIncremented(ChatMessage chatMessage)
 {
     Assert.IsTrue(chatMessage.Id > 0, "ChatMessage Identity column was not incremented!");
 }