Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions Source/Mockolate/Setup/PropertySetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,6 @@ protected override TResult InvokeGetter<TResult>(MockBehavior behavior, Func<TRe
}
}

if (!_isInitialized)
{
_value = defaultValueGenerator() is T value ? value : default!;
_isInitialized = true;
}

if (!TryCast(_value, out TResult result))
{
throw new MockException(
Expand Down
11 changes: 0 additions & 11 deletions Tests/Mockolate.Tests/MockProperties/SetupPropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ namespace Mockolate.Tests.MockProperties;

public sealed partial class SetupPropertyTests
{
[Fact]
public async Task InitializeValue_NotMatchingTypes_ShouldUseDefault()
{
MyPropertySetup<int> setup = new();

setup.MyInitializeValue("f");

int result = setup.InvokeGetter<int>();
await That(result).IsEqualTo(0);
}

[Fact]
public async Task InvokeGetter_InvalidType_ShouldThrowMockException()
{
Expand Down
Loading