wcf ria services - Why is my WCF RIA context throwing FileNotFound exceptions during unit tests? -


i'm trying write unit tests involving wcf ria entity proxies , when try access entity's parent or child properties through association filenotfoundexception when webcontext class fails load system.xml.

for example, have 2 entities defined in web project in entity framework - course , courseunit. course has many courseunit children. i'm not exposing ria contexts or viewmodels, hidden behind interfaces. i'm using moq mock these interfaces , return standard ria entity proxies unit tests.

this works fine when i'm testing things like

assert.areequal("title", course.title)

where course instance of ria proxy. however, if like

assert.areequal(0, course.courseunits.count)

i following exception

filenotfoundexception unhandled user code not load file or assembly 'system.xml, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e' or 1 of dependencies. system cannot find file specified.

and if execute code in unit test involved 1 of these relationships code throws same exception. if ever try access these properties association relationships tests break.

the exception occurs in generated code. found in file [webprojectname].g.cs in partial class course : entity , happens in courseunits getter.

any ideas?

edit - added reference entityframework assembly , exception has changed same thing system.componentmodel.dataannotations instead of system.xml. needless have tried referencing both assemblies in unit test project, , didn't work.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -