Typo in Tutorial pages; removed unused parameter from IMethodStubber.SubMethod.

This commit is contained in:
mclift 2017-01-31 21:05:31 +00:00
Родитель e934be1c66
Коммит 864a0eefb1
6 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -168,7 +168,7 @@ stub.GetContactPhoneNumber((p1, p2) => 11122233, overwrite:true);
## Default behaviors
In the default ```MockBehavior.Stict``` mode, stubs that are called before their behaviors have been set will throw an exception. This can be changed—so that uninitialized stubs will return ```null``` or a default value—by using ```MockBehavior.Loose```:
In the default ```MockBehavior.Strict``` mode, stubs that are called before their behaviors have been set will throw an exception. This can be changed—so that uninitialized stubs will return ```null``` or a default value—by using ```MockBehavior.Loose```:
```csharp
var stub = new StubIPhoneBook()

Просмотреть файл

@ -14,7 +14,7 @@ namespace Etg.SimpleStubs.CodeGen
/// </summary>
internal class EventStubber : IMethodStubber
{
public ClassDeclarationSyntax StubMethod(CompilationUnitSyntax cu, ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel)
public ClassDeclarationSyntax StubMethod(ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel)
{
// only handle EventAdd and ignore EventRemove because we only need to stub the event once
if (!methodSymbol.IsEventAdd())

Просмотреть файл

@ -1,11 +1,10 @@
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Etg.SimpleStubs.CodeGen
{
internal interface IMethodStubber
{
ClassDeclarationSyntax StubMethod(CompilationUnitSyntax cu, ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel);
ClassDeclarationSyntax StubMethod(ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel);
}
}

Просмотреть файл

@ -70,7 +70,7 @@ namespace Etg.SimpleStubs.CodeGen
foreach (IMethodStubber methodStubber in _methodStubbers)
{
classDclr = methodStubber.StubMethod(cu, classDclr, methodSymbol, interfaceType, semanticModel);
classDclr = methodStubber.StubMethod(classDclr, methodSymbol, interfaceType, semanticModel);
}
}
return classDclr;

Просмотреть файл

@ -9,7 +9,7 @@ namespace Etg.SimpleStubs.CodeGen
{
internal class OrdinaryMethodStubber : IMethodStubber
{
public ClassDeclarationSyntax StubMethod(CompilationUnitSyntax cu, ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel)
public ClassDeclarationSyntax StubMethod(ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel)
{
if (!methodSymbol.IsOrdinaryMethod())
{

Просмотреть файл

@ -12,7 +12,7 @@ namespace Etg.SimpleStubs.CodeGen
internal class StubbingDelegateGenerator : IMethodStubber
{
public ClassDeclarationSyntax StubMethod(CompilationUnitSyntax cu, ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel)
public ClassDeclarationSyntax StubMethod(ClassDeclarationSyntax classDclr, IMethodSymbol methodSymbol, INamedTypeSymbol stubbedInterface, SemanticModel semanticModel)
{
if (methodSymbol.IsPropertyAccessor() || methodSymbol.IsOrdinaryMethod())
{