diff --git a/README.md b/README.md index bcd4eed1..0d75c23f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/ROCK1 - Cannot Mock Sealed Types.md b/docs/ROCK1 - Cannot Mock Sealed Types.md index 35435fe2..ce014347 100644 --- a/docs/ROCK1 - Cannot Mock Sealed Types.md +++ b/docs/ROCK1 - Cannot Mock Sealed Types.md @@ -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(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK11 - Type Has Match With Non Virtual .md b/docs/ROCK11 - Type Has Match With Non Virtual .md index a05a2101..4cfa286e 100644 --- a/docs/ROCK11 - Type Has Match With Non Virtual .md +++ b/docs/ROCK11 - Type Has Match With Non Virtual .md @@ -27,5 +27,5 @@ public abstract class TypeConverter : ITypeConverter } // This will generate ROCK11 -var expectations = Rock.Create>(); +[assembly: RockCreate>] ``` \ No newline at end of file diff --git a/docs/ROCK12 - Duplicate Constructors.md b/docs/ROCK12 - Duplicate Constructors.md index d2846042..e0f9b114 100644 --- a/docs/ROCK12 - Duplicate Constructors.md +++ b/docs/ROCK12 - Duplicate Constructors.md @@ -11,8 +11,8 @@ public class AnyOf } // This will not generate ROCK12 -var validExpectations = Rock.Create>(); +[assembly: RockCreate>] // This will generate ROCK12 -var invalidExpectations = Rock.Create>(); +[assembly: RockCreate>] ``` \ No newline at end of file diff --git a/docs/ROCK13 - Type Error.md b/docs/ROCK13 - Type Error.md index 92eea906..3943e1ad 100644 --- a/docs/ROCK13 - Type Error.md +++ b/docs/ROCK13 - Type Error.md @@ -7,8 +7,8 @@ public interface IBase } // This will generate ROCK13 -var validExpectations = Rock.Create>(); +[assembly: RockCreate>] // This will not generate ROCK13 -var invalidExpectations = Rock.Create>(); +[assembly: RockCreate>] ``` \ No newline at end of file diff --git a/docs/ROCK2 - Cannot Mock Obsolete Types.md b/docs/ROCK2 - Cannot Mock Obsolete Types.md index a0255efd..9f923e8f 100644 --- a/docs/ROCK2 - Cannot Mock Obsolete Types.md +++ b/docs/ROCK2 - Cannot Mock Obsolete Types.md @@ -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(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK3 - Type Has No Mockable Members.md b/docs/ROCK3 - Type Has No Mockable Members.md index 71ac7512..a501390c 100644 --- a/docs/ROCK3 - Type Has No Mockable Members.md +++ b/docs/ROCK3 - Type Has No Mockable Members.md @@ -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(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK4 - Type Has No Accessible Constructors.md b/docs/ROCK4 - Type Has No Accessible Constructors.md index d4c910ff..60245e49 100644 --- a/docs/ROCK4 - Type Has No Accessible Constructors.md +++ b/docs/ROCK4 - Type Has No Accessible Constructors.md @@ -10,5 +10,5 @@ public class TypeToMock } // This will generate ROCK4 -var expectations = Rock.Create(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK5 - Cannot Specify Type With Open Generic Parameters.md b/docs/ROCK5 - Cannot Specify Type With Open Generic Parameters.md index 8291855d..bdc7ec78 100644 --- a/docs/ROCK5 - Cannot Specify Type With Open Generic Parameters.md +++ b/docs/ROCK5 - Cannot Specify Type With Open Generic Parameters.md @@ -3,12 +3,6 @@ If the given type has open generic parameters, a mock cannot be created. ```csharp public interface IMock { ... } -public class Factory -{ - public IMock Mock() - { - // This will generate ROCK5 - var expectations = Rock.Create>; - } -} +// This will generate ROCK5 +[assembly: RockCreate>] ``` \ No newline at end of file diff --git a/docs/ROCK6 - Cannot Mock Special Types.md b/docs/ROCK6 - Cannot Mock Special Types.md index e7b573d4..f7cdb5c0 100644 --- a/docs/ROCK6 - Cannot Mock Special Types.md +++ b/docs/ROCK6 - Cannot Mock Special Types.md @@ -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(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK7 - Interface Has Static Abstract Members.md b/docs/ROCK7 - Interface Has Static Abstract Members.md index a1286977..d653c248 100644 --- a/docs/ROCK7 - Interface Has Static Abstract Members.md +++ b/docs/ROCK7 - Interface Has Static Abstract Members.md @@ -8,5 +8,5 @@ public interface IHaveStaticAbstractMembers } // This will generate ROCK7 -var expectations = Rock.Create(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK8 - Type Has Inaccessible Abstract Members.md b/docs/ROCK8 - Type Has Inaccessible Abstract Members.md index 87308e9a..69816575 100644 --- a/docs/ROCK8 - Type Has Inaccessible Abstract Members.md +++ b/docs/ROCK8 - Type Has Inaccessible Abstract Members.md @@ -9,5 +9,5 @@ public abstract class InternalTargets } // This will generate ROCK8 -var expectations = Rock.Create(); +[assembly: RockCreate] ``` \ No newline at end of file diff --git a/docs/ROCK9 - Member Uses Obsolete Type.md b/docs/ROCK9 - Member Uses Obsolete Type.md index 7ad52046..5b84d148 100644 --- a/docs/ROCK9 - Member Uses Obsolete Type.md +++ b/docs/ROCK9 - Member Uses Obsolete Type.md @@ -10,5 +10,5 @@ public interface IUseObsolete } // This will generate ROCK9 -var expectations = Rock.Create(); +[assembly: RockCreate] ``` \ No newline at end of file