Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Frictionless WCF service consumption in Silverlight - Part 3: Benefits of transparent asynchrony with respect to unit testing

, 26 May 2011
Simplifying unit testing of View Models which use asynchronous WCF service calls.
FrictSLUnitTest.zip
Source
Sample.Silverlight.WCF
Infrastructure
Actions
Services
Properties
Shared
Utility
Views
Sample.Silverlight.WCF.Tests
Properties
Sample.Silverlight.WCF.Tests.Clumsy
Properties
DataSources
Sample.Silverlight.WCF.Web.Services.Task.datasource
Service References
ServiceReference1
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
TaskService.disco
TaskService.wsdl
ServiceReferences.ClientConfig
Sample.Silverlight.WCF.Tests.Clumsy.Web
Properties
Sample.Silverlight.WCF.Web
Properties
Services
TaskService.svc
Tools
NUnit
nunit.framework.dll
nunit.silverlight.dll
Rhino.Mocks
Castle.Core-Silverlight.dll
Castle.DynamicProxy-Silverlight.dll
Rhino.Mocks 3.5.Silverlight.dll
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{DC247B7D-755D-4980-A2A9-B99540516A03}</ProjectGuid>
    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Sample.Silverlight.WCF.Tests.Clumsy</RootNamespace>
    <AssemblyName>Sample.Silverlight.WCF.Tests.Clumsy</AssemblyName>
    <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures />
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>Sample.Silverlight.WCF.Tests.Clumsy.xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>Sample.Silverlight.WCF.Tests.Clumsy.App</SilverlightAppEntry>
    <TestPageFileName>TestPage.html</TestPageFileName>
    <CreateTestPage>true</CreateTestPage>
    <ValidateXaml>true</ValidateXaml>
    <EnableOutOfBrowser>false</EnableOutOfBrowser>
    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
    <UsePlatformExtensions>false</UsePlatformExtensions>
    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
    <LinkedServerProject />
  </PropertyGroup>
  <!--
  //
  // Silverlight Code Coverage Instrumentation
  // List any libraries or assemblies that you would like to instrument during
  // a code coverage pass. An example, for ClassLibrary1, is provided, and
  // commented out below as a starting point:
  //
  -->
  <!--
  <ItemGroup>
    <InstrumentSilverlightAssemblies Include="SilverlightClassLibrary1">
      <Visible>false</Visible>
    </InstrumentSilverlightAssemblies>
  </ItemGroup>
  -->
  <!-- This property group is only here to support building this project using the 
       MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs 
       to set the TargetFrameworkVersion to v3.5 -->
  <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>Bin\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Bin\Release</OutputPath>
    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.Silverlight.Testing">
      <HintPath>$(MSBuildExtensionsPath)\..\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Testing\Microsoft.Silverlight.Testing.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight">
      <HintPath>$(MSBuildExtensionsPath)\..\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Testing\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
    </Reference>
    <Reference Include="Rhino.Mocks 3.5.Silverlight">
      <HintPath>..\..\Tools\Rhino.Mocks\Rhino.Mocks 3.5.Silverlight.dll</HintPath>
    </Reference>
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.Windows" />
    <Reference Include="mscorlib" />
    <Reference Include="system" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Windows.Browser" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="TaskManagementViewModelWithMocking.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Service References\ServiceReference1\Reference.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Reference.svcmap</DependentUpon>
    </Compile>
    <Compile Include="TaskManagementViewModel.cs" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </ApplicationDefinition>
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\AppManifest.xml" />
    <None Include="Properties\DataSources\Sample.Silverlight.WCF.Web.Services.Task.datasource" />
    <None Include="Service References\ServiceReference1\TaskService.wsdl" />
    <None Include="Service References\ServiceReference1\TaskService.xsd">
      <SubType>Designer</SubType>
    </None>
    <None Include="Service References\ServiceReference1\TaskService1.xsd">
      <SubType>Designer</SubType>
    </None>
    <None Include="Service References\ServiceReference1\TaskService2.xsd">
      <SubType>Designer</SubType>
    </None>
    <Content Include="ServiceReferences.ClientConfig" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Sample.Silverlight.WCF\Sample.Silverlight.WCF.csproj">
      <Project>{9FE130EE-EF70-41C0-AC45-4037256752E7}</Project>
      <Name>Sample.Silverlight.WCF</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <WCFMetadata Include="Service References\" />
  </ItemGroup>
  <ItemGroup>
    <WCFMetadataStorage Include="Service References\ServiceReference1\" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Service References\ServiceReference1\TaskService.disco" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Service References\ServiceReference1\configuration91.svcinfo" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Service References\ServiceReference1\configuration.svcinfo" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Service References\ServiceReference1\Reference.svcmap">
      <Generator>WCF Proxy Generator</Generator>
      <LastGenOutput>Reference.cs</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
  <Import Condition="$(SilverlightVersion)=='v3.0'" Project="$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SilverlightToolkit\Tools\v3.0)Microsoft.Silverlight.Toolkit.Build.targets" />
  <Import Condition="$(SilverlightVersion)=='v4.0'" Project="$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SilverlightToolkit\Tools\v4.0)Microsoft.Silverlight.Toolkit.Build.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
        <SilverlightProjectProperties />
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

Yevhen Bobrov
Software Developer http://blog.xtalion.com
Ukraine Ukraine
No Biography provided
Follow on   Twitter

| Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 26 May 2011
Article Copyright 2011 by Yevhen Bobrov
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid