Closed Kagandaj closed 1 year ago
Object reference not set to an instance of an object
the line that fails actually says that the module.Application is null, so it looks like your test setup is not appropriate.
eXpand constructs a XafApplication and then adds the module u can find examples in all the tests e.g. https://github.com/eXpandFramework/Reactive.XAF/blob/42582751eb4e447a59bac05324bb741ae9f9c255/src/Tests/AutoCommit/AutoCommitTests.cs#L42
you can use the same packages Xpand.TestsLib* and desing similar tests
Thanks for this work
I Have this helper method for testing projects that works well without expand
public static IModelApplication LoadApplicationModel(this ModuleBase module) { var manager = new ApplicationModulesManager(); manager.AddModule(module); manager.Load(XafTypesInfo.Instance, true); return new DesignerModelFactory().CreateApplicationModel(module, manager, ModelStoreBase.Empty); }
However it fails when i add expand modules to the application. is there a way to create IModelApplication when using rx.xaf modulesexception System.NullReferenceException: 'Object reference not set to an instance of an object.'
callstack at Xpand.Persistent.Base.General.ModuleBaseExtensions.GetConnectionString(ModuleBase moduleBase) in E:\proj\eXpandFramework\eXpand\Xpand\Xpand.Persistent\Xpand.Persistent.Base\General\XpandModuleBase.cs:line 802