Skip to content

Commit

Permalink
Restore line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinjahn committed Nov 23, 2024
1 parent 0d26cdd commit 9cfd241
Show file tree
Hide file tree
Showing 14 changed files with 548 additions and 548 deletions.
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace CSharpFunctionalExtensions.Tests.MaybeTests.Extensions
{
public class MapTests_Task_Left : MaybeTestBase
{
[Fact]
public async Task Map_Task_Left_returns_mapped_value()
{
Maybe<T> maybe = T.Value;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn(T.Value, T.Value2));

maybe2.HasValue.Should().BeTrue();
maybe2.Value.Should().Be(T.Value2);
}

[Fact]
public async Task Map_Task_Left_returns_no_value_if_initial_maybe_is_null()
{
Maybe<T> maybe = null;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn(null, T.Value2));

maybe2.HasValue.Should().BeFalse();
}

[Fact]
public async Task Map_Task_Left_provides_context_to_selector()
{
Maybe<T> maybe = T.Value;
var context = 5;

var maybe2 = await maybe
.AsTask()
.Map(
(value, ctx) =>
{
ctx.Should().Be(context);
return value;
},
context
);

maybe2.HasValue.Should().BeTrue();
}
}
}
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace CSharpFunctionalExtensions.Tests.MaybeTests.Extensions
{
public class MapTests_Task_Left : MaybeTestBase
{
[Fact]
public async Task Map_Task_Left_returns_mapped_value()
{
Maybe<T> maybe = T.Value;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn(T.Value, T.Value2));

maybe2.HasValue.Should().BeTrue();
maybe2.Value.Should().Be(T.Value2);
}

[Fact]
public async Task Map_Task_Left_returns_no_value_if_initial_maybe_is_null()
{
Maybe<T> maybe = null;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn(null, T.Value2));

maybe2.HasValue.Should().BeFalse();
}

[Fact]
public async Task Map_Task_Left_provides_context_to_selector()
{
Maybe<T> maybe = T.Value;
var context = 5;

var maybe2 = await maybe
.AsTask()
.Map(
(value, ctx) =>
{
ctx.Should().Be(context);
return value;
},
context
);

maybe2.HasValue.Should().BeTrue();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace CSharpFunctionalExtensions.Tests.MaybeTests.Extensions
{
public class MapTests_Task_Right : MaybeTestBase
{
[Fact]
public async Task Map_Task_Right_returns_mapped_value()
{
Maybe<T> maybe = T.Value;

var maybe2 = await maybe.Map(ExpectAndReturn_Task(T.Value, T.Value2));

maybe2.HasValue.Should().BeTrue();
maybe2.Value.Should().Be(T.Value2);
}

[Fact]
public async Task Map_Task_Right_returns_no_value_if_initial_maybe_is_null()
{
Maybe<T> maybe = null;

var maybe2 = await maybe.Map(ExpectAndReturn_Task(null, T.Value2));

maybe2.HasValue.Should().BeFalse();
}

[Fact]
public async Task Map_Task_Right_provides_context_to_selector()
{
Maybe<T> maybe = T.Value;
var context = 5;

var maybe2 = await maybe.Map(
(value, ctx) =>
{
ctx.Should().Be(context);
return value.AsTask();
},
context
);

maybe2.HasValue.Should().BeTrue();
}
}
}
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace CSharpFunctionalExtensions.Tests.MaybeTests.Extensions
{
public class MapTests_Task_Right : MaybeTestBase
{
[Fact]
public async Task Map_Task_Right_returns_mapped_value()
{
Maybe<T> maybe = T.Value;

var maybe2 = await maybe.Map(ExpectAndReturn_Task(T.Value, T.Value2));

maybe2.HasValue.Should().BeTrue();
maybe2.Value.Should().Be(T.Value2);
}

[Fact]
public async Task Map_Task_Right_returns_no_value_if_initial_maybe_is_null()
{
Maybe<T> maybe = null;

var maybe2 = await maybe.Map(ExpectAndReturn_Task(null, T.Value2));

maybe2.HasValue.Should().BeFalse();
}

[Fact]
public async Task Map_Task_Right_provides_context_to_selector()
{
Maybe<T> maybe = T.Value;
var context = 5;

var maybe2 = await maybe.Map(
(value, ctx) =>
{
ctx.Should().Be(context);
return value.AsTask();
},
context
);

maybe2.HasValue.Should().BeTrue();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace CSharpFunctionalExtensions.Tests.MaybeTests.Extensions
{
public class MapTests_Task : MaybeTestBase
{
[Fact]
public async Task Map_Task_returns_mapped_value()
{
Maybe<T> maybe = T.Value;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn_Task(T.Value, T.Value2));

maybe2.HasValue.Should().BeTrue();
maybe2.Value.Should().Be(T.Value2);
}

[Fact]
public async Task Map_Task_returns_no_value_if_initial_maybe_is_null()
{
Maybe<T> maybe = null;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn_Task(null, T.Value2));

maybe2.HasValue.Should().BeFalse();
}

[Fact]
public async Task Map_Task_provides_context_to_selector()
{
Maybe<T> maybe = T.Value;
var context = 5;

var maybe2 = await maybe
.AsTask()
.Map(
(value, ctx) =>
{
ctx.Should().Be(context);
return value.AsTask();
},
context
);

maybe2.HasValue.Should().BeTrue();
}
}
}
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

namespace CSharpFunctionalExtensions.Tests.MaybeTests.Extensions
{
public class MapTests_Task : MaybeTestBase
{
[Fact]
public async Task Map_Task_returns_mapped_value()
{
Maybe<T> maybe = T.Value;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn_Task(T.Value, T.Value2));

maybe2.HasValue.Should().BeTrue();
maybe2.Value.Should().Be(T.Value2);
}

[Fact]
public async Task Map_Task_returns_no_value_if_initial_maybe_is_null()
{
Maybe<T> maybe = null;

var maybe2 = await maybe.AsTask().Map(ExpectAndReturn_Task(null, T.Value2));

maybe2.HasValue.Should().BeFalse();
}

[Fact]
public async Task Map_Task_provides_context_to_selector()
{
Maybe<T> maybe = T.Value;
var context = 5;

var maybe2 = await maybe
.AsTask()
.Map(
(value, ctx) =>
{
ctx.Should().Be(context);
return value.AsTask();
},
context
);

maybe2.HasValue.Should().BeTrue();
}
}
}
Loading

0 comments on commit 9cfd241

Please sign in to comment.