Ejemplo n.º 1
0
        public void ThenSourceFormatRESTDeleteMethodReturnsBadRequest(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

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

            statusCode.Should().Be((int)HttpStatusCode.BadRequest);
        }
Ejemplo n.º 2
0
        public void ThenSourceFormatDimensionStructureNodeEndpointReturnsAnError(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

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

            result.Should().Be(400);
        }
Ejemplo n.º 3
0
        public async Task WhenIRequestListOfInactiveSourceFormats(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            DilibHttpClientResponse <List <SourceFormat> > result = await _masterDataHttpClient
                                                                    .SourceFormatHttpClient
                                                                    .GetInactives()
                                                                    .ConfigureAwait(false);

            _scenarioContext.Add(instance.ResultKey, result.Result);
        }
Ejemplo n.º 4
0
        public void ThenSourceFormatDimensionStructureNodeDimensionStructureNodeIdNullableEqualsTo(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            SourceFormatDimensionStructureNode node = _scenarioContext[instance.Key]
                                                      as SourceFormatDimensionStructureNode;

            Check.IsNotNull(node);

            node.DimensionStructureNodeId.Should().BeNull();
        }
        public async Task WhenDimensionStructureDeleteEndpointIsCalled(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

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

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

            _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
        }
        public async Task WhenSourceFormatIsSentToSourceFormatEndpointDeleteMethod(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            SourceFormat tobeDeleted = _scenarioContext[instance.Key] as SourceFormat;

            DilibHttpClientResponse <SourceFormat> result = await _masterDataHttpClient
                                                            .SourceFormatHttpClient
                                                            .DeleteAsync(tobeDeleted)
                                                            .ConfigureAwait(false);

            _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
        }
        public async Task WhenToBeInactivatedSourceFormatDomainObjectIsSentToSourceFormatEndpoint(Table table)
        {
            Check.IsNotNull(table);

            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            SourceFormat toBeInactivated = _scenarioContext[instance.Key] as SourceFormat;

            DilibHttpClientResponse <SourceFormat> result = await _masterDataHttpClient
                                                            .SourceFormatHttpClient
                                                            .InactivateAsync(toBeInactivated)
                                                            .ConfigureAwait(false);

            _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
        }
        public async Task WhenModifiedSourceFormatDomainObjectIsSentToSourceFormatEndpoint(Table table)
        {
            Check.IsNotNull(table);
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            SourceFormat sourceFormat = _scenarioContext[instance.Key]
                                        as SourceFormat;

            Check.IsNotNull(sourceFormat);

            DilibHttpClientResponse <SourceFormat> result = await _masterDataHttpClient
                                                            .SourceFormatHttpClient
                                                            .UpdateAsync(sourceFormat)
                                                            .ConfigureAwait(false);

            _scenarioContext.Add(instance.ResultKey, result.Result);
        }
Ejemplo n.º 9
0
        public async Task WhenDimensionStructureGetAllEndpointIsCalled(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            DilibHttpClientResponse <List <DimensionStructure> > result = await _masterDataHttpClient
                                                                          .DimensionStructureHttpClient
                                                                          .GetAllAsync()
                                                                          .ConfigureAwait(false);

            if (result.IsSuccess)
            {
                _scenarioContext.Add(instance.ResultKey, result.Result);
            }
            else
            {
                _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
            }
        }
Ejemplo n.º 10
0
        public async Task GivenThereIsASavedDimensionStructureNodeDomainObject(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            DimensionStructureNode node = _dimensionStructureNodeFaker.Generate();

            DilibHttpClientResponse <DimensionStructureNode> result = await _masterDataHttpClient
                                                                      .SourceFormatHttpClient
                                                                      .CreateDimensionStructureNodeAsync(node)
                                                                      .ConfigureAwait(false);

            if (!result.IsSuccess)
            {
                throw new Exception(result.ExceptionMessage);
            }

            _scenarioContext.Add(instance.ResultKey, result.Result);
        }
        public async Task WhenADimensionStructureIsRequested(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

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

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

            if (result.IsSuccess)
            {
                _scenarioContext.Add(instance.ResultKey, result.Result);
            }
            else
            {
                _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
            }
        }
Ejemplo n.º 12
0
        public async Task GivenDimensionStructureIsSentToTheAddEndpoint(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

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

            DilibHttpClientResponse <DimensionStructure> result = await _masterDataHttpClient
                                                                  .DimensionStructureHttpClient
                                                                  .AddAsync(saved)
                                                                  .ConfigureAwait(false);

            if (result.IsSuccess)
            {
                _scenarioContext.Add(instance.ResultKey, result.Result);
            }
            else
            {
                _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
            }
        }
        public async Task WhenSourceFormatDomainObjectIsSentToSourceFormatEndpoint(Table table)
        {
            KeyResultKeyEntity instance = table.CreateInstance <KeyResultKeyEntity>();

            SourceFormat sourceFormat = _scenarioContext[instance.Key]
                                        as SourceFormat;

            DilibHttpClientResponse <SourceFormat> result = await _masterDataHttpClient
                                                            .SourceFormatHttpClient
                                                            .AddAsync(sourceFormat)
                                                            .ConfigureAwait(false);

            if (result.IsSuccess)
            {
                _scenarioContext.Add(instance.ResultKey, result.Result);
            }
            else
            {
                _scenarioContext.Add(instance.ResultKey, result.HttpStatusCode);
            }
        }
 public SourceFormatDimensionStructureNode Create(KeyResultKeyEntity instance)
 {
     return(new SourceFormatDimensionStructureNode());
 }