コード例 #1
0
 public UnitTest()
 {
     _sourceA = new SourceClassA
     {
         Integer = 1
     };
     _sourceB = new SourceClassB
     {
         String = "stringB"
     };
     _target = new TargetClass
     {
         Integer = 2,
         String  = "stringT"
     };
     _someInterfaceMock = new Mock <ISomeInterface>();
     _someInterfaceMock.Setup(m => m.DoInterfaceStuff <TargetClass>(_sourceA)).Returns(_target);
     _someInterfaceMock.Setup(m => m.DoInterfaceStuff(_sourceB, _target)).Returns(_target);
     _sut = new SomeClass(_someInterfaceMock.Object);
 }
コード例 #2
0
 public TargetClass DoClassStuff(SourceClassA sourceClassA, SourceClassB sourceClassB)
 {
     return(_someInterface.DoExtensionStuff <TargetClass>(sourceClassA, sourceClassB));
 }