我必須使用MSUnit測試框架有一個私有方法如何做返回類型爲Void的私有方法的Assert階段?
public class MyClass
{
private void SomeMethod(PrimaryAllocationDP packet)
{
........................
some code
........................
packet.AllocatedAgency = AgencyAllocated;
}
}
現在一個班,我至今
[TestMethod]
public void TestAllocatedAgency()
{
var packet = new Fixture().Create<PrimaryAllocationDP>(); //used AutoFixture here
PrivateObject accessor = new PrivateObject(new MyClass());
accessor.Invoke("SomeMethod", packet); //Act
what will be the Assert???? Since it is void
}
會是怎樣的斷言寫????既然它是無效的,我該如何編寫斷言?
幫助需要