コード例 #1
0
        public void BodyExpressionWorksWithDefaultConstructor()
        {
            // Arrange & Act
            var body = new BodyExpression();

            // Assert
            Assert.Equal("body", body.Expression);
        }
コード例 #2
0
        public Distinctions Compare <T1>(T1 expected, T1 actual, string propertyName)
        {
            var a = (T)(object)expected;
            var b = (T)(object)actual;

            return(CompareFunc.Compile()(a, b)
                ? Distinctions.None()
                : Distinctions.Create(new[]
            {
                _display.GetDistinction(a, b, propertyName,
                                        BodyExpression.Get(CompareFunc).ToString())
            }));
        }
コード例 #3
0
        public void BodyExpressionConstructorCreateCorrectBodyExpression()
        {
            // Arrange
            string      expression = "#/user/uuid";
            JsonPointer pointer    = new JsonPointer(expression);

            // Act
            var body = new BodyExpression(pointer);

            // Assert
            Assert.Equal("body#/user/uuid", body.Expression);
            Assert.Equal("/user/uuid", body.Fragment);
        }