Skip to content

Commit

Permalink
Removed logic to decrement the index by 1.
Browse files Browse the repository at this point in the history
Changed file name/path
  • Loading branch information
abaskett3 committed Sep 1, 2019
1 parent 3a532df commit f043a4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
6 changes: 0 additions & 6 deletions BroAPI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.28307.271
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BroAPI", "BroAPI\BroAPI.csproj", "{BEF180F7-014C-45F1-AC22-DB4730155AAC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BroAPI.Tests", "BroAPI.Tests\BroAPI.Tests.csproj", "{06E6EC6D-2D2E-41BA-B349-30A8A54CFD11}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -17,10 +15,6 @@ Global
{BEF180F7-014C-45F1-AC22-DB4730155AAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEF180F7-014C-45F1-AC22-DB4730155AAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEF180F7-014C-45F1-AC22-DB4730155AAC}.Release|Any CPU.Build.0 = Release|Any CPU
{06E6EC6D-2D2E-41BA-B349-30A8A54CFD11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06E6EC6D-2D2E-41BA-B349-30A8A54CFD11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06E6EC6D-2D2E-41BA-B349-30A8A54CFD11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06E6EC6D-2D2E-41BA-B349-30A8A54CFD11}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 4 additions & 3 deletions BroAPI/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ public string FunctionHandler(ILambdaContext context)
var broList = GetBroNames();

//randomize
var broCount = (broList.BroNames.Count() - 1);
Int32 broCount = broList.BroNames.Count();
Random rand = new Random();
var index = rand.Next(0, broCount);
int index = rand.Next(0, broCount);

//return
return broList.BroNames[index].ToString();

Expand All @@ -30,7 +31,7 @@ public string FunctionHandler(ILambdaContext context)

public BroList GetBroNames()
{
string startupPath = Environment.CurrentDirectory + "\\BroNames.json";
string startupPath = Environment.CurrentDirectory + "\\names.json";
Console.WriteLine(startupPath);

using (StreamReader r = new StreamReader(startupPath))
Expand Down
6 changes: 0 additions & 6 deletions BroAPI/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ If already installed check if new version is available.
dotnet tool update -g Amazon.Lambda.Tools
```

Execute unit tests
```
cd "BroAPI/test/BroAPI.Tests"
dotnet test
```

Deploy function to AWS Lambda
```
cd "BroAPI/src/BroAPI"
Expand Down

0 comments on commit f043a4c

Please sign in to comment.