Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6674359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:44:09+00:00 2026-05-26T03:44:09+00:00

I have Silverligth Unit test Application (.net 4.0) and I’ve added reference to my

  • 0

I have Silverligth Unit test Application (.net 4.0) and I’ve added reference to my WCF service(3.5)

And here are my codes

MyService.svc

<%@ServiceHost Language="VB" Service="MyServiceWS.Service1" %>

MyService.asmx

<System.Web.Services.WebService(Namespace:="http://schemas.mypage.co.uk/MyService")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ServiceContract(Namespace:="http://schemas.mypage.co.uk/MyService")> _
<ServiceKnownType(GetType(Member))> _
<ToolboxItem(False)> _
Public Class Service1
    Inherits System.Web.Services.WebService

From reference.cs

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class Service1Client : System.ServiceModel.ClientBase<MyServiceApp.MyServiceService.Service1>, MyServiceApp.MyServiceService.Service1 {

my testclass:

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace MyServiceApp.UnitTests
{
    [TestClass]
    public class ShowroomLogViewModelTests
    {
        [TestMethod]
        public void ReloadShowroomLogs_IsBusyShouldBeFalse()
        {
            var mockedWebService = Mock<IService1>;

Problem is that:

IService1 cannot be resolved

How can I mock my wcf service?

EDIT: One Step Closer

var mockedWebService =new Mock<MyService.Service1>;

I’ve changed to this and now is compiling, but…
I haven’ access to method, e.g.

mockedWebService.GetShowroomLogs();

It is a big problem, because, I need change a property ServiceClient at ShowroomLogViewModel to interface, and I can’t because then my viewmodel can’t use wcf service methods.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:44:10+00:00Added an answer on May 26, 2026 at 3:44 am

    You should do this: mockedWebService.Object.GetShowroomLogs();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight app that consumes a WCF service in my asp.net application.The
I have a silverlight 2 beta 2 application that accesses a WCF web service.
I have a Silverlight 2 application that is consuming a WCF service. As such,
I have a solution with two service projects (one is hosting a unit test
I have a typical Silverlight application with a WCF service and I am using
I would like to perform a unit test in Silverlight, with VB.net. I have
I have Silverlight application which connects to a WCF service. If i open the
I have silverlight application, where I use Entity Framework(PostgreSQL) and WCF(not RIA). Here is
I have created a silverllight unit test page and it has the reference to
I have Silverlight application that retrieves data from the database through a WCF Service.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.