예제 #1
0
        public async Task DaxFormatterClient_FormatAsync_SpacingStyleIsHonored(DaxFormatterSpacingStyle spacingStyle, string expression, string expectedExpression)
        {
            var request = new DaxFormatterSingleRequest
            {
                Dax = expression,
                SkipSpaceAfterFunctionName = spacingStyle
            };

            var response = await _fixture.Client.FormatAsync(request);

            Assert.NotNull(response);

            var actualExpression = response.Formatted;

            Assert.Equal(expectedExpression, actualExpression);
        }
        public void DaxFormatterSingleRequest_SkipSpaceAfterFunctionNameSerialization(DaxFormatterSpacingStyle spacingStyle, bool expectedSpacingStyle)
        {
            var request = new DaxFormatterSingleRequest
            {
                SkipSpaceAfterFunctionName = spacingStyle
            };

            var property            = GetJsonProperty(request, nameof(DaxFormatterSingleRequest.SkipSpaceAfterFunctionName));
            var currentSpacingStyle = property.GetBoolean();

            Assert.Equal(expectedSpacingStyle, currentSpacingStyle);
        }