0
sdelot created
Hi, (Asp.net Mvc 5x and JQuery) I tried to Test my app through .Test project, it was failed. but when i try the same app in browser console the result was correct. how can i test the app through .Test project.
public class LicielJobApp_Test : AppTestBase { private readonly ILicielJobsAppService _LicielJobsAppService;
public LicielJobApp_Test()
{
_LicielJobsAppService = Resolve<ILicielJobsAppService>();
}
[Fact]
public void Should_get_jobList()
{
var job = _LicielJobsAppService.GetLicielJobs(new GetLicielJobsInput());
job.Items.Count.ShouldBe(2);
}
1 Answer(s)
-
0
Hi @SDELOT,
Unit test are not using your real database. You need to create fake datas for unit tests. You can do it in TestDataBuilder class.
Thanks.