mardi 3 mai 2016

how to use structureMap.autoMocking with objectFactory.BuildUp

my class is like:

public class BillingAccountBLService : IBillingAccountBLService
{
    [SetterProperty]
    public IContractService ContractService { get; set; }

    public BillingAccountBLService()
    {
        ObjectFactory.BuildUp(this);
     }
}

in my test:

[Test]
public void ContractDoesNotExist()
{
   var mocks = new RhinoAutoMocker<BillingAccountBLService>();
   var service = mocks.ClassUnderTest;
   ...

on this row exception thrown "StructureMap.StructureMapConfigurationException : No default Instance is registered and cannot be automatically determined for type..." (type of first injected service)

how should i fix this?

thanks!

Aucun commentaire:

Enregistrer un commentaire