Skip to content

Commit

Permalink
Atualização do Projeto
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfariakof committed Jun 8, 2024
1 parent fb8cac2 commit 35e8a71
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 317 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: Build and Test
on:
workflow_call:

push:
branches:
- main
- develop

pull_request:
types: [opened, synchronize, reopened]
types: [opened]
branches:
- main

permissions:
contents: read

jobs:
build_and_test_net:
name: Build and Test .Net App
Expand Down Expand Up @@ -76,8 +73,8 @@ jobs:
npm run test:coverage
continue-on-error: false

trigger_tests_sonarcloud:
needs: build_and_test_angular
name: Triggered Build and Test
uses: alexfariakof/Home_Broker_Chart/.github/workflows/test_analyse_in_Sonar_Cloud.yml@main
secrets: inherit
# trigger_tests_sonarcloud:
# needs: build_and_test_angular
# name: Triggered Build and Test
# uses: alexfariakof/app-home-broker-chart/.github/workflows/test_analyse_in_Sonar_Cloud.yml@main
# secrets: inherit
6 changes: 2 additions & 4 deletions .github/workflows/deploy_prod_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Deploy Production App
on:
push:
tags:
- v*.*.*

- v*.*.*
permissions:
contents: read

jobs:
trigger_build_and_test:
name: Triggered Deploy Prod
uses: alexfariakof/Home_Broker_Chart/.github/workflows/build_and_test.yml@main
uses: alexfariakof/app-home-broker-chart/.github/workflows/build_and_test.yml@main
secrets: inherit

deploy:
Expand Down
11 changes: 0 additions & 11 deletions Business/Business.csproj

This file was deleted.

12 changes: 6 additions & 6 deletions Business/HomeBrokerBusiness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public Sma GetSMA(Period period)
var sma = new Sma(this.GetHistoryData(period).Select(price => price.Close).ToList());
return sma;
}
catch (Exception ex)
catch
{
throw ex;
throw new ArgumentException("Erro ao gerar SMA.");
}
}
public Ema GetEMA(int periodDays, Period period)
Expand All @@ -37,9 +37,9 @@ public Ema GetEMA(int periodDays, Period period)
var ema = new Ema(this.GetHistoryData(period).Select(price => price.Close).ToList(), periodDays);
return ema;
}
catch (Exception ex)
catch
{
throw ex;
throw new ArgumentException("Erro ao gerar EMA.");
}
}
public MACD GetMACD(Period period)
Expand All @@ -49,9 +49,9 @@ public MACD GetMACD(Period period)
var macd = new MACD(this.GetHistoryData(period).Select(price => price.Close).ToList());
return macd;
}
catch (Exception ex)
catch
{
throw ex;
throw new ArgumentException("Erro ao gerar MACD.");
}
}
}
10 changes: 0 additions & 10 deletions Domain/Domain.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion HomeBrokerSPA/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:8.0 as final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "HomeBrokerSPA.dll"]
ENTRYPOINT ["dotnet", "HomeBroker.SPA.dll"]
30 changes: 0 additions & 30 deletions HomeBrokerSPA/Dockerfile-Development

This file was deleted.

29 changes: 0 additions & 29 deletions HomeBrokerSPA/Dockerfile-Production

This file was deleted.

16 changes: 0 additions & 16 deletions HomeBrokerSPA/HomeBrokerChart/HomeBrokerChart.esproj

This file was deleted.

70 changes: 0 additions & 70 deletions HomeBrokerSPA/HomeBrokerSPA.csproj

This file was deleted.

11 changes: 7 additions & 4 deletions HomeBrokerSPA/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,22 @@

var app = builder.Build();

if (app.Environment.IsStaging()) {
if (app.Environment.IsStaging())
{
app.Urls.Add("http://0.0.0.0:3002");
app.Urls.Add("https://0.0.0.0:3003");
}
else if (app.Environment.IsEnvironment("Swagger"))
{
app.Urls.Add("http://127.0.0.1:5000");
app.Urls.Add("https://127.0.0.1:5001");
}
else
{
app.UseHttpsRedirection();
app.UseHsts();
app.UseAuthorization();
}

app.UseHsts();
app.UseSwagger();
app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", $"{appName} {appVersion}"); });

Expand All @@ -54,7 +57,7 @@
option.AddRedirect("^$", "swagger");
app.UseRewriter(option);
}
app.UseAuthorization();

app.MapControllers();
app.UseDefaultFiles();
app.UseStaticFiles();
Expand Down
41 changes: 0 additions & 41 deletions HomeBrokerXUnit/.Faker/MagazineLuizaHistoryPriceFaker.cs

This file was deleted.

2 changes: 1 addition & 1 deletion HomeBrokerXUnit/Business/HomeBrokerBusinessTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Domain.Charts.ValueObject;
using HomeBrokerXUnit.Faker;
using HomeBrokerXUnit.__mock__;
using Repository.Interfaces;
using Moq;

Expand Down
8 changes: 4 additions & 4 deletions HomeBrokerXUnit/Controllers/ChartHomeBrokerControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Domain.Charts.Agreggates;
using Domain.Charts.ValueObject;
using HomeBrokerSPA.Controllers;
using HomeBrokerXUnit.Faker;
using HomeBrokerXUnit.__mock__;
using Microsoft.AspNetCore.Mvc;
using Moq;

Expand Down Expand Up @@ -124,7 +124,7 @@ public void Should_Return_BadRequest_GetSMA()
Assert.NotNull(result);
Assert.IsType<BadRequestObjectResult>(result);
var value = Assert.IsType<BadRequestObjectResult>(result).Value;
var message = value.GetType().GetProperty("message").GetValue(value, null) as string;
var message = value?.GetType()?.GetProperty("message")?.GetValue(value, null) as string;
Assert.Equal("Get SMA Exeption", message);
}

Expand All @@ -144,7 +144,7 @@ public void Should_Return_BadRequest_GetEMA()
Assert.NotNull(result);
Assert.IsType<BadRequestObjectResult>(result);
var value = Assert.IsType<BadRequestObjectResult>(result).Value;
var message = value.GetType().GetProperty("message").GetValue(value, null) as string;
var message = value?.GetType()?.GetProperty("message")?.GetValue(value, null) as string;
Assert.Equal("Get EMA Exeption", message);
}

Expand All @@ -164,7 +164,7 @@ public void Should_Return_BadRequest_GetMACD()
Assert.NotNull(result);
Assert.IsType<BadRequestObjectResult>(result);
var value = Assert.IsType<BadRequestObjectResult>(result).Value;
var message = value.GetType().GetProperty("message").GetValue(value, null) as string;
var message = value?.GetType()?.GetProperty("message")?.GetValue(value, null) as string;
Assert.Equal("Get MACD Exeption", message);
}
}
Loading

0 comments on commit 35e8a71

Please sign in to comment.