1
현재 "노력"프레임 워크 (http://effort.codeplex.com/wikipage?title=Tutorials&referringTitle=Home)를 사용하여 Entity Framework의 컨텍스트 클래스를 단위 테스트하려고합니다. 마지막 줄이 작동하지노력을 통한 단위 테스트
[TestMethod]
public void GetUseraccountsForRealTest()
{
DbConnection connection = Effort.DbConnectionFactory.CreateTransient();
SqlContext context = new SqlContext(connection);
context.TaskComment.Add(new TaskComment() { Id = 1, Message = "Test" });
}
:
이 내 시험은 현재 모습입니다. 아무 반응이 없습니다.
public class SqlContext : DbContext
{
...
public IDbSet<TaskComment> TaskComment { get; set; }
...
//Constructor used by webserver
public SqlContext(string connectionString) : base(connectionString)
{
}
//Constructor used for unit testing
public SqlContext(DbConnection connection) : base(connection, true)
{
this.Configuration.LazyLoadingEnabled = false;
}
///
/// <param name="modelBuilder"></param>
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
}
}
누구든지 내가이 문제를 해결하는 방법에 대한 아이디어를 가지고 :
이 내는 SqlContext 클래스는 모습입니다? "노력"에 대한 경험이 없으며 너무 많은 문서가 없습니다. :-(