Skip to content

Commit

Permalink
Naming the different tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Baudin999 committed Dec 26, 2019
1 parent cc1fb41 commit 535e5d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ApplicationTests/SchoolExampleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ public async Task InitModule()
[Fact]
public async Task CompileSchoolModule()
{
Console.WriteLine("STARTED: CompileSchoolModule");
await Init();
project.ParseAllModules();
var ast = project.GetAstForModule("School");
Assert.True(ast.Count > 0);
Console.WriteLine("FINISHED: CompileSchoolModule");
}

[Fact]
public async Task RenameSchoolModule()
{
Console.WriteLine("STARTED: RenameSchoolModule");
await Init();
await project.MoveModule("School", "Foo.Bar");
Assert.False(File.Exists(path("School.car")), "School.car file still exists.");
Expand All @@ -64,26 +67,31 @@ public async Task RenameSchoolModule()
Assert.NotNull(project.FindModule("Foo.Bar"));

await Task.Run(() => Task.Delay(100));
Console.WriteLine("FINISHED: RenameSchoolModule");
}

[Fact]
public async Task AddStudentModule()
{
Console.WriteLine("STARTED: AddStudentModule");
await Init();
var studentModule = await project.CreateModule("Student");
var schoolModule = project.FindModule("School");

Assert.NotNull(studentModule);
Assert.NotNull(schoolModule);
Console.WriteLine("FINISHED: AddStudentModule");
}

[Fact]
public async Task DeleteSchoolModule()
{
Console.WriteLine("STARTED: DeleteSchoolModule");
await Init();
await project.DeleteModule("School");
var schoolModule = project.FindModule("School");
Assert.Null(schoolModule);
Console.WriteLine("FINISHED: DeleteSchoolModule");
}
}
}
2 changes: 1 addition & 1 deletion Project/FileProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public async Task<Module> MoveModule(string oldName, string newName)

_ = await DeleteModule(oldName);
var module = await CreateModule(newName);
module.SaveCode(code);
await module.SaveCode(code);
return module;
}

Expand Down

0 comments on commit 535e5d6

Please sign in to comment.