Esempio n. 1
0
        public void TestMergeNews()
        {
            var newsToMerge = new NewsEntity
            {
                PartitionKey = "partitionKey",
                RowKey       = "rowKey",
                Title        = "title",
                Content      = "content",
                Author       = "author"
            };

            var newsDifferentTitle = new NewsEntity
            {
                PartitionKey = "partitionKey",
                RowKey       = "rowKey",
                Title        = "differentTitle",
                Content      = "content",
                Author       = "author"
            };

            var newsDifferentContent = new NewsEntity
            {
                PartitionKey = "partitionKey",
                RowKey       = "rowKey",
                Title        = "title",
                Content      = "differentContent",
                Author       = "author"
            };

            newsDifferentTitle.Merge(newsToMerge);
            newsDifferentContent.Merge(newsToMerge);

            Assert.AreEqual(newsDifferentTitle.Title, newsToMerge.Title);
            Assert.AreEqual(newsDifferentTitle.Content, newsToMerge.Content);
        }