0

hiii i am getting this error while running test for my fluent nhibernate application. not sure whats causing it .

here are my mappings and my domain

 public class Employee
{
    public virtual String emp_code { get; set; }
    public virtual String emp_name { get; set; }
    public virtual String expertise_id { get; set; }
    public virtual String grade_id { get; set; }
    public virtual String role_id { get; set; }
    public virtual String Status { get; set; }
    public virtual String email_id { get; set; }
}

this is my mapping

 public class EmployeeMap:ClassMap<Employee>
{
    public EmployeeMap()
    {
        Table("employee_master");
        Id(x => x.emp_code);
        Map(x => x.emp_name);
        Map(x => x.expertise_id);
        Map(x => x.grade_id);
        Map(x => x.role_id);
        Map(x => x.Status);
        Map(x => x.email_id);
    }
}

and my test class :

public class Test
{
    private ISessionFactory sessionFactory;

    [Test]
    public void Can_generate_schema()
    {

       sessionFactory = Fluently.Configure(cfg).Database(MsSqlConfiguration.MsSql2008.ConnectionString(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
                  .Mappings(m => m.FluentMappings.AddFromAssemblyOf<EmployeeMap>()).BuildSessionFactory();

    }
}

can someone tell me why am i getting the error ??? what might cause it ?

4
  • How about posting the whole exception stack trace (vincnetas.tumblr.com/post/1130542373/stack-trace-or-gtfo)? Commented Apr 23, 2011 at 3:34
  • where is cfg being initialized in the code above? Commented Apr 23, 2011 at 18:01
  • @Cole okie sorry i got d error !! thanks :) it was my fault dint initialize the cfg here Commented Apr 25, 2011 at 11:45
  • I posted this below. Accept it as the answer. Commented Apr 25, 2011 at 12:00

1 Answer 1

1

Check to make sure cfg is initialized above.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.