mardi 29 décembre 2015

Why is my WCF service not working in Test Project?

Something strange is happening. I have a WCF service using C# and Visual Studio 2015 up and running.

This service is published to my local IIS and I have a test website where I can consume my services and display results. The website is running in the visual studio IIS on a generated port.

I have a test project which is where I'm experiencing a problem. In the test project I run the same code that works in the website. However when I debug it my wcf result is already out of context.

  • The test fails
  • The service result 'does not exist in the current context' when debugging.

        [TestMethod]
        public void Test_GetListOfFastPlans()
        {
            FastPlanFileShareServiceClient client = new FastPlanFileShareServiceClient();
    
            ListSharedFastPlansResult thisismyresult = client.ListOfSharedFastPlans("asdf", "asdf", null, null, null, false);
    
            Assert.IsTrue(thisismyresult.ServiceResult.WasSuccessful);
        }
    
    

I can step through the entire code block from creating the client to making the call and finally the assertion without any errors. however, the resultclass and the client are never in context.

I don't know what is happening or how to diagnosis the issues.

Aucun commentaire:

Enregistrer un commentaire