Skip to content

Commit

Permalink
Added blank AssemblyInfo.cs to the GettingStarted project and one uni…
Browse files Browse the repository at this point in the history
…t test
  • Loading branch information
ChrisMissal committed Nov 28, 2009
1 parent c95506e commit d6af93e
Show file tree
Hide file tree
Showing 33 changed files with 10,107 additions and 10,077 deletions.
144 changes: 72 additions & 72 deletions Rhino.Mocks.GettingStarted/Rhino.Mocks.GettingStarted.csproj
@@ -1,73 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" 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>{59F8A3E2-80C5-4250-909A-16741DF81B23}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rhino.Mocks.GettingStarted</RootNamespace>
<AssemblyName>Rhino.Mocks.GettingStarted</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedLibs\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Helpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Stubs.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="GettingStarted.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Rhino.Mocks\Rhino.Mocks.csproj">
<Project>{1E8FECC7-9E9B-4275-A938-D956F5E5D4F8}</Project>
<Name>Rhino.Mocks</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" 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>{59F8A3E2-80C5-4250-909A-16741DF81B23}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rhino.Mocks.GettingStarted</RootNamespace>
<AssemblyName>Rhino.Mocks.GettingStarted</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<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</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedLibs\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Helpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Stubs.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="GettingStarted.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Rhino.Mocks\Rhino.Mocks.csproj">
<Project>{1E8FECC7-9E9B-4275-A938-D956F5E5D4F8}</Project>
<Name>Rhino.Mocks</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
86 changes: 58 additions & 28 deletions Rhino.Mocks.GettingStarted/Stubs.cs
@@ -1,29 +1,59 @@
using NUnit.Framework;

namespace Rhino.Mocks.GettingStarted
{
[TestFixture]
public class Stubs
{
[Test]
public void Demonstrate_Stub_Implements_the_passed_type()
{
// Arrange

// Act
var stub = MockRepository.GenerateStub<IFoo>();

// Assert
Assert.That(stub.Implements<IFoo>());
}

/// <summary>
/// This is just a sample interface, what it is or does isn't really relevant. It could
/// be IUser of IOrder
/// </summary>
public interface IFoo
{
string Name { get; set; }
}
}
using NUnit.Framework;

namespace Rhino.Mocks.GettingStarted
{
[TestFixture]
public class Stubs
{
[Test]
public void Demonstrate_Stub_Implements_the_passed_type()
{
// Arrange

// Act
var stub = MockRepository.GenerateStub<IFoo>();

// Assert
Assert.That(stub.Implements<IFoo>());
}

/// <summary>
/// When you need to mock a read-only property of a class.
/// </summary>
[Test]
public void How_to_Stub_out_your_own_value_of_a_ReadOnlyProperty()
{
// Arrange
var foo = MockRepository.GenerateStub<IFoo>();
foo.Stub(x => x.ID).Return(123);

// Act
var id = foo.ID;

// Assert
Assert.That(id, Is.EqualTo(123));
}

/// <summary>
/// This is just a sample interface, what it is or does isn't really relevant. It could
/// be IUser of IOrder
/// </summary>
public interface IFoo
{
int ID { get; }
string Name { get; set; }
}

public class Foo : IFoo
{
private int id;

public int ID
{
get { return id; }
}

public string Name { get; set; }
}
}
}

0 comments on commit d6af93e

Please sign in to comment.