Example #1
0
        public void BitbucketLink_Roundtrips()
        {
            // Arrange
            JObject data = EmbeddedResource.ReadAsJObject("Microsoft.AspNet.WebHooks.Messages.PushMessage.json");
            BitbucketLink expectedLink = new BitbucketLink
            {
                Reference = "https://bitbucket.org/henrikfrystyknielsen/henrikntest01"
            };

            // Act
            BitbucketLink actualLink = data["repository"]["links"]["html"].ToObject<BitbucketLink>();

            // Assert
            string expectedJson = JsonConvert.SerializeObject(expectedLink);
            string actualJson = JsonConvert.SerializeObject(actualLink);
            Assert.Equal(expectedJson, actualJson);
        }
        public void BitbucketLink_Roundtrips()
        {
            // Arrange
            JObject       data         = EmbeddedResource.ReadAsJObject("Microsoft.AspNet.WebHooks.Messages.PushMessage.json");
            BitbucketLink expectedLink = new BitbucketLink
            {
                Reference = "https://bitbucket.org/henrikfrystyknielsen/henrikntest01"
            };

            // Act
            BitbucketLink actualLink = data["repository"]["links"]["html"].ToObject <BitbucketLink>();

            // Assert
            string expectedJson = JsonConvert.SerializeObject(expectedLink);
            string actualJson   = JsonConvert.SerializeObject(actualLink);

            Assert.Equal(expectedJson, actualJson);
        }