Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
973fd6d
Initial support for a legacy API shim
kzu Jul 23, 2019
b83445a
Add codegen support for new Mock<T>
kzu Jul 23, 2019
a58ad2d
Setup should happen as soon as possible
kzu Jul 23, 2019
72a1a28
Make sure we use the test calling assembly
adalon Jul 24, 2019
df46b70
Added SkipBehavior support for behavior pipeline
adalon Jul 24, 2019
5aaca90
Add new behavior for setup scope runs
kzu Jul 24, 2019
0c2ff79
Add setup overloads to avoid the mock T argument
kzu Jul 24, 2019
60237fe
Added AsMoq extension method
adalon Jul 24, 2019
eda348b
Simplify Behavior implementation by using SkipBehaviors
kzu Jul 24, 2019
edc7b68
Revert "Add setup overloads to avoid the mock T argument"
kzu Jul 24, 2019
efeefc3
Fix failing tests
kzu Jul 24, 2019
4e9d640
Move setup scope to Moq
kzu Jul 24, 2019
004e96e
Fix visiblity of various Sdk-like classes in the Moq main assembly
kzu Jul 24, 2019
91b4853
Added CallBase support
adalon Jul 24, 2019
58a67fe
Don't run FixupImports twice
kzu Jul 25, 2019
3f191e7
Ensure both analyzers and codefixers have NuGetPackageId metadata
kzu Jul 25, 2019
4c5db10
Optimize codegen performance for real world solutions
kzu Jul 25, 2019
e159b48
Do not clean unused namespaces, since it is costly for little benefit
kzu Jul 25, 2019
814afdc
Bump to latest Roslyn for VS2017 and updated supported code fix names
kzu Jul 25, 2019
708db5b
Ensure a clean restore is performed always, add CI feed
kzu Jul 25, 2019
20b9fd2
Set proper names for CallBase tests
adalon Jul 25, 2019
6143a8a
Bump TFV to the 16.0+ official one supporting NS2
kzu Jul 29, 2019
e5b1c4e
Properly generate code for generic mocks
kzu Aug 3, 2019
d9bbc2e
Add support for mocking generic types
kzu Aug 6, 2019
34a6c49
Move OverrideAllMembersCodeFix to CodeFix assembly to avoid csc error
kzu Aug 6, 2019
1e97239
Don't assume mocked types will be public
kzu Aug 6, 2019
e30d526
Cleanup and encapsulate the batch code fixer and avoid state capturing
kzu Aug 6, 2019
f4b4be4
Delete OverrideAllMembersCodeFix class that moved to CodeFix
kzu Aug 6, 2019
d5e5fd7
Re-enable end to end tests for VB since they work now
kzu Aug 6, 2019
cfddaf2
Fix roslyn internals tests from moved RoslynInternals.cs file
kzu Aug 8, 2019
2e4f6e8
Fix minor style issues flagged by codefactor.io
kzu Aug 8, 2019
462cf05
Unify naming conventions for runtime lookup
kzu Aug 8, 2019
83a22b0
Minor docs tweaks to CallBase
kzu Aug 8, 2019
db87731
Drastically simplify As<T> support by adding new Mock<T...Tn>
kzu Aug 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix minor style issues flagged by codefactor.io
  • Loading branch information
kzu committed Aug 8, 2019
commit 2e4f6e856930277c15a46bcc8cfc16f1e7487d08
1 change: 0 additions & 1 deletion src/Moq/Moq.CodeFix/MockGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ public MockGenerator(NamingConvention naming)
{
}
}

}
2 changes: 1 addition & 1 deletion src/Moq/Moq.Tests/CallBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.ComponentModel;
using Xunit;
using Moq.Sdk;
using static Moq.Syntax;
using Sample;
using static Moq.Syntax;

namespace Moq.Tests
{
Expand Down
3 changes: 0 additions & 3 deletions src/Moq/Moq.Tests/Mocks/CalculatorMock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,15 @@ public override bool TryAdd(ref int x, ref int y, out int z)
public override void TurnOn() =>
pipeline.Execute(new MethodInvocation(this, MethodBase.GetCurrentMethod()), (m, n) => { base.TurnOn(); return m.CreateValueReturn(null); });


public override void Store(string name, int value) =>
pipeline.Execute(new MethodInvocation(this, MethodBase.GetCurrentMethod(), name, value), (m, n) => { base.Store(name, value); return m.CreateValueReturn(null, name, value); });

public override int? Recall(string name) =>
pipeline.Execute<int?>(new MethodInvocation(this, MethodBase.GetCurrentMethod(), name), (m, n) => m.CreateValueReturn(base.Recall(name), name));


public override void Clear(string name) =>
pipeline.Execute(new MethodInvocation(this, MethodBase.GetCurrentMethod(), name), (m, n) => { base.Clear(name); return m.CreateValueReturn(null, name); });


public override ICalculatorMemory Memory
{
get => pipeline.Execute<ICalculatorMemory>(new MethodInvocation(this, MethodBase.GetCurrentMethod()), (m, n) => m.CreateValueReturn(base.Memory));
Expand Down
5 changes: 2 additions & 3 deletions src/Moq/Moq/CallBaseExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ public static T CallBase<T>(this T target)
{
// set CallBase
i.Context[nameof(IMoq.CallBase)] = true;

return next().Invoke(i.Target.AsMock(), i, next);

}, nameof(IMoq.CallBase)));
},
nameof(IMoq.CallBase)));
}

return target;
Expand Down
2 changes: 0 additions & 2 deletions src/Moq/Moq/Moq`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

namespace Moq
{


/// <summary>
/// Provides the Moq specific configurations on top of an <see cref="Sdk.IMock{T}"/> that
/// the Moq API provides beyond the SDK.
Expand Down
3 changes: 0 additions & 3 deletions src/Samples/Sample/CalculatorClassStunt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,15 @@ public override bool TryAdd(ref int x, ref int y, out int z)
public override void TurnOn() =>
pipeline.Execute(new MethodInvocation(this, MethodBase.GetCurrentMethod()), (m, n) => { base.TurnOn(); return m.CreateValueReturn(null); });


public override void Store(string name, int value) =>
pipeline.Execute(new MethodInvocation(this, MethodBase.GetCurrentMethod(), name, value), (m, n) => { base.Store(name, value); return m.CreateValueReturn(null, name, value); });

public override int? Recall(string name) =>
pipeline.Execute<int?>(new MethodInvocation(this, MethodBase.GetCurrentMethod(), name), (m, n) => m.CreateValueReturn(base.Recall(name), name));


public override void Clear(string name) =>
pipeline.Execute(new MethodInvocation(this, MethodBase.GetCurrentMethod(), name), (m, n) => { base.Clear(name); return m.CreateValueReturn(null, name); });


public override ICalculatorMemory Memory
{
get => pipeline.Execute<ICalculatorMemory>(new MethodInvocation(this, MethodBase.GetCurrentMethod()), (m, n) => m.CreateValueReturn(base.Memory));
Expand Down
1 change: 0 additions & 1 deletion src/Stunts/Stunts.CodeAnalysis/StuntGeneratorAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ private void AnalyzeSyntaxNode(SyntaxNodeAnalysisContext context)
}
else
{

typeArguments = method.TypeArguments;
}

Expand Down