English 中文(简体)
单位何时测试负荷依赖的组件?
原标题:When does a unit test load dependent assemblies?

我需要更好地了解集会装上单位测试时的情况。

我有一个班子()。 I is Unit Test. <代码>ClassDerived源自另一类(<>ClassBase)。

我试图在进行第一次测试之前使用<代码>ClassInitialize的属性。 该股的测试项目参考了<代码>ClassBase和ClassDerived

在使用<代码>ClassInitialize方法中的代码时,我注意到含有<代码>ClassDerived<>代码的组件没有装上。

我通过从电话到<代码>GetAssemblies()的回报价值来确定这一点。

var assemblies = System.AppDomain.CurrentDomain.GetAssemblies();

装满了<代码>ClassBase的组件。

我试图将初始化代码移至联检组测试师,结果相同。

是否有任何人知道正在发生什么?

最佳回答

我怀疑载荷的时间不是单位检测的特例。 在方框3.5中,我在这里看到:

Given an assembly X that has method Y , and method Y uses something in assembly Z .

在这种情况下,Z组装货将是在Y方法执行之前装货的。 .net 4.0 supposely在几个战线上引进了更大的人道度,因此我不知道上述观察是否仍然真实。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签