Esempio n. 1
0
        public void ThenOperationResultIs(Table table)
        {
            KeyExpectedValueEntity instance = table.CreateInstance <KeyExpectedValueEntity>();

            int result = (int)_scenarioContext[instance.Key];

            int expected = Convert.ToInt32(instance.ExpectedValue);

            result.Should().Be(expected);
        }
        public void ThenDimensionStructureIdPropertyIs(Table table)
        {
            KeyExpectedValueEntity instance = table.CreateInstance <KeyExpectedValueEntity>();

            DimensionStructure result = _scenarioContext[instance.Key] as DimensionStructure;

            Check.IsNotNull(result);

            int exp = Convert.ToInt32(instance.ExpectedValue);

            result.IsActive.Should().Be(exp);
        }
Esempio n. 3
0
        public void ThenSourceFormatDimensionStructureNodeDeleteOperationResultIs(Table table)
        {
            KeyExpectedValueEntity instance = table.CreateInstance <KeyExpectedValueEntity>();

            object result = _scenarioContext[instance.Key];

            string expectedValue = instance.ExpectedValue;
            bool   areAllDigits  = expectedValue.All(char.IsDigit);

            if (areAllDigits)
            {
                result.Should().Be(Convert.ToInt32(expectedValue));
            }
        }
Esempio n. 4
0
        public void ThenSingleSourceFormatDimensionStructureNodeItemRequestResultIs(Table table)
        {
            KeyExpectedValueEntity instance = table.CreateInstance <KeyExpectedValueEntity>();

            DilibHttpClientResponse <SourceFormatDimensionStructureNode> result = _scenarioContext[instance.Key]
                                                                                  as DilibHttpClientResponse <SourceFormatDimensionStructureNode>;

            Check.IsNotNull(result);

            if (instance.ExpectedValue == "null")
            {
                result.Result.Should().BeNull();
            }
        }
Esempio n. 5
0
        public async Task ThenADimensionStructureIsRequestedResultIs(Table table)
        {
            KeyExpectedValueEntity instance = table.CreateInstance <KeyExpectedValueEntity>();

            DimensionStructure dimensionStructure = _scenarioContext[instance.Key] as DimensionStructure;

            DilibHttpClientResponse <DimensionStructure> result = await _masterDataHttpClient
                                                                  .DimensionStructureHttpClient
                                                                  .GetByIdAsync(dimensionStructure)
                                                                  .ConfigureAwait(false);

            if (result.IsSuccess)
            {
                result.Result.Should().BeNull();
            }
            else
            {
                result.IsSuccess.Should().BeTrue();
            }
        }