Skip to content

Commit

Permalink
Updated diagnostic docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBock committed Jan 22, 2024
1 parent eacb0e8 commit 1af2175
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Reference the `Rocks` [NuGet package](https://www.nuget.org/packages/Rocks) - th

### Prerequisites

The Rocks package targets .NET Standard 2.0 for host flexibility. Note that Rocks looks for, and generates, code that targets .NET 7.
The Rocks package targets .NET Standard 2.0 for host flexibility. Note that Rocks looks for, and generates, code that targets .NET 8.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/ROCK1 - Cannot Mock Sealed Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ If the given type is sealed, a mock cannot be created.
public sealed class TypeToMock { }

// This will generate ROCK1
var expectations = Rock.Create<TypeToMock>();
[assembly: RockCreate<TypeToMock>]
```
2 changes: 1 addition & 1 deletion docs/ROCK11 - Type Has Match With Non Virtual .md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public abstract class TypeConverter<TType> : ITypeConverter<TypeNode>
}

// This will generate ROCK11
var expectations = Rock.Create<TypeConverter<TypeNode>>();
[assembly: RockCreate<TypeConverter<TypeNode>>]
```
4 changes: 2 additions & 2 deletions docs/ROCK12 - Duplicate Constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class AnyOf<T1, T2>
}

// This will not generate ROCK12
var validExpectations = Rock.Create<AnyOf<string, int>>();
[assembly: RockCreate<AnyOf<string, int>>]

// This will generate ROCK12
var invalidExpectations = Rock.Create<AnyOf<string, string>>();
[assembly: RockCreate<AnyOf<string, string>>]
```
4 changes: 2 additions & 2 deletions docs/ROCK13 - Type Error.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public interface IBase<T1, T2>
}

// This will generate ROCK13
var validExpectations = Rock.Create<IBase<,>>();
[assembly: RockCreate<IBase<,>>]

// This will not generate ROCK13
var invalidExpectations = Rock.Create<IBase<int, int>>();
[assembly: RockCreate<IBase<int, int>>]
```
2 changes: 1 addition & 1 deletion docs/ROCK2 - Cannot Mock Obsolete Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ If the given type is marked as being obsolete, a mock cannot be created.
public sealed class TypeToMock { }

// This will generate ROCK2
var expectations = Rock.Create<TypeToMock>();
[assembly: RockCreate<TypeToMock>]
```
2 changes: 1 addition & 1 deletion docs/ROCK3 - Type Has No Mockable Members.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ If the given type has no members that can be mocked, a mock cannot be created.
public interface ITypeToMock { }

// This will generate ROCK3
var expectations = Rock.Create<ITypeToMock>();
[assembly: RockCreate<ITypeToMock>]
```
2 changes: 1 addition & 1 deletion docs/ROCK4 - Type Has No Accessible Constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public class TypeToMock
}

// This will generate ROCK4
var expectations = Rock.Create<TypeToMock>();
[assembly: RockCreate<TypeToMock>]
```
10 changes: 2 additions & 8 deletions docs/ROCK5 - Cannot Specify Type With Open Generic Parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ If the given type has open generic parameters, a mock cannot be created.
```csharp
public interface IMock<T> { ... }

public class Factory<T>
{
public IMock<T> Mock()
{
// This will generate ROCK5
var expectations = Rock.Create<IMock<T>>;
}
}
// This will generate ROCK5
[assembly: RockCreate<IMock<T>>]
```
2 changes: 1 addition & 1 deletion docs/ROCK6 - Cannot Mock Special Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Certain types, like enums, delegates, and value types, cannot be mocked.
public enum Values { One, Two, Three }

// This will generate ROCK6
var expectations = Rock.Create<Values>();
[assembly: RockCreate<Values>]
```
2 changes: 1 addition & 1 deletion docs/ROCK7 - Interface Has Static Abstract Members.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHaveStaticAbstractMembers
}

// This will generate ROCK7
var expectations = Rock.Create<IHaveStaticAbstractMembers>();
[assembly: RockCreate<IHaveStaticAbstractMembers>]
```
2 changes: 1 addition & 1 deletion docs/ROCK8 - Type Has Inaccessible Abstract Members.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public abstract class InternalTargets
}

// This will generate ROCK8
var expectations = Rock.Create<InternalTargets>();
[assembly: RockCreate<InternalTargets>]
```
2 changes: 1 addition & 1 deletion docs/ROCK9 - Member Uses Obsolete Type.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public interface IUseObsolete
}

// This will generate ROCK9
var expectations = Rock.Create<IUseObsolete>();
[assembly: RockCreate<IUseObsolete>]
```

0 comments on commit 1af2175

Please sign in to comment.