unit-Tests ein unit of work

neues zu unit-Tests. Ich habe eine Einheit der Arbeit, dass ich versuche, das Gerät zu testen. Ich bin wahrscheinlich etwas fehlt einfach hier. Ich bin versucht zu unit-testen Sie die Commit-Methode. Ich bin mit nunit und moq.

public class  UnitOfWork : IUnitOfWork
{
    private readonly DbContext _context;
    public UnitOfWork(DbContext ctx)
    {
        _context = ctx;
    }

    public void Commit()
    {
        _context.SaveChanges();
    }
}

Was muss ich tun, um dies zu testen?

InformationsquelleAutor Justin | 2011-06-14
Schreibe einen Kommentar