Skip to content

Commit 149c523

Browse files
Implement request endpoint and test (#32)
* Add IsCorrect Bool on Submission * Work on Request Command * Add database call for requesting a challenge * Setup Test project and rename RequestCommand to Request * Create Unit Tests Add migration from nvarchar to string because sqllite doesn't handle a nvarchar(max) * Fix ci for dotnet test
1 parent 56da0d2 commit 149c523

26 files changed

+611
-63
lines changed

.github/workflows/Build-Test-And-Deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
npm run test run
5454
5555
- name: Test with dotnet
56-
run: dotnet test --no-build
56+
run: dotnet test --no-build --configuration Release
5757

5858
- name: Dotnet Publish
5959
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/IntellitectTerminal

IntellitectTerminal.Data/Migrations/20220805023634_IsCorrect bool on Submission Model.Designer.cs

+118
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace IntellitectTerminal.Data.Migrations
6+
{
7+
public partial class IsCorrectboolonSubmissionModel : Migration
8+
{
9+
protected override void Up(MigrationBuilder migrationBuilder)
10+
{
11+
migrationBuilder.AddColumn<bool>(
12+
name: "IsCorrect",
13+
table: "Submissions",
14+
type: "bit",
15+
nullable: false,
16+
defaultValue: false);
17+
}
18+
19+
protected override void Down(MigrationBuilder migrationBuilder)
20+
{
21+
migrationBuilder.DropColumn(
22+
name: "IsCorrect",
23+
table: "Submissions");
24+
}
25+
}
26+
}

IntellitectTerminal.Data/Migrations/20220805034807_Change data type to string from nvarchar.Designer.cs

+114
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace IntellitectTerminal.Data.Migrations
6+
{
7+
public partial class Changedatatypetostringfromnvarchar : Migration
8+
{
9+
protected override void Up(MigrationBuilder migrationBuilder)
10+
{
11+
migrationBuilder.AlterColumn<string>(
12+
name: "FileSystem",
13+
table: "Users",
14+
type: "nvarchar(max)",
15+
nullable: true,
16+
oldClrType: typeof(string),
17+
oldType: "nvarchar(MAX)",
18+
oldMaxLength: 2147483647,
19+
oldNullable: true);
20+
21+
migrationBuilder.AlterColumn<string>(
22+
name: "Content",
23+
table: "Submissions",
24+
type: "nvarchar(max)",
25+
nullable: true,
26+
oldClrType: typeof(string),
27+
oldType: "nvarchar(MAX)",
28+
oldMaxLength: 2147483647,
29+
oldNullable: true);
30+
31+
migrationBuilder.AlterColumn<string>(
32+
name: "Question",
33+
table: "Challenges",
34+
type: "nvarchar(max)",
35+
nullable: true,
36+
oldClrType: typeof(string),
37+
oldType: "nvarchar(MAX)",
38+
oldMaxLength: 2147483647,
39+
oldNullable: true);
40+
41+
migrationBuilder.AlterColumn<string>(
42+
name: "Answer",
43+
table: "Challenges",
44+
type: "nvarchar(max)",
45+
nullable: true,
46+
oldClrType: typeof(string),
47+
oldType: "nvarchar(MAX)",
48+
oldMaxLength: 2147483647,
49+
oldNullable: true);
50+
}
51+
52+
protected override void Down(MigrationBuilder migrationBuilder)
53+
{
54+
migrationBuilder.AlterColumn<string>(
55+
name: "FileSystem",
56+
table: "Users",
57+
type: "nvarchar(MAX)",
58+
maxLength: 2147483647,
59+
nullable: true,
60+
oldClrType: typeof(string),
61+
oldType: "nvarchar(max)",
62+
oldNullable: true);
63+
64+
migrationBuilder.AlterColumn<string>(
65+
name: "Content",
66+
table: "Submissions",
67+
type: "nvarchar(MAX)",
68+
maxLength: 2147483647,
69+
nullable: true,
70+
oldClrType: typeof(string),
71+
oldType: "nvarchar(max)",
72+
oldNullable: true);
73+
74+
migrationBuilder.AlterColumn<string>(
75+
name: "Question",
76+
table: "Challenges",
77+
type: "nvarchar(MAX)",
78+
maxLength: 2147483647,
79+
nullable: true,
80+
oldClrType: typeof(string),
81+
oldType: "nvarchar(max)",
82+
oldNullable: true);
83+
84+
migrationBuilder.AlterColumn<string>(
85+
name: "Answer",
86+
table: "Challenges",
87+
type: "nvarchar(MAX)",
88+
maxLength: 2147483647,
89+
nullable: true,
90+
oldClrType: typeof(string),
91+
oldType: "nvarchar(max)",
92+
oldNullable: true);
93+
}
94+
}
95+
}

0 commit comments

Comments
 (0)