0
나는이 오류를 알아 내려고 노력하고있다. moq 프레임 워크를 사용하여 모의 테스트를 수행하고 있습니다. 테스트 코드는 내가 나는 다음과 같은 오류가 그것을 실행하면모의 테스트에서 계약 이름을 찾을 수 없습니다.
[TestFixture]
[ServiceContract]
public class UnitTest1
{
private ServiceHost host;
[Test]
public void TestMethod()
{
Mock mk = new Mock<ChatInterfaces.IChatService>();
host = new ServiceHost(mk);
host.AddServiceEndpoint(typeof(IChatService), new NetTcpBinding()
, "net.tcp://localhost:8080/ChatService");
host.Open();
Console.WriteLine("Testing");
app.config 파일이 바인딩
<system.serviceModel>
<services>
<service name="ChatInterfaces.IChatService">
<endpoint address="net.tcp://localhost:8080/ChatService" binding="netTcpBinding" bindingConfiguration="BindingConfiguration" name="ChatServiceEndPoint" contract="ChatInterfaces.IChatService">
</endpoint>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="BindingConfiguration" transferMode="Buffered"/>
</netTcpBinding>
</bindings>
</system.serviceModel>
다음했다입니다.
Result Message: System.InvalidOperationException : The contract name 'ChatInterfaces.IChatService' could not be found in the list of contracts implemented by the service 'Moq.Mock`1[[ChatInterfaces.IChatService, ChatInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
여기서 내가 잘못하고 어떻게 수정합니까? 덕분에