mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 23:15:40 +00:00
Compare commits
No commits in common. "b977b7a4ecd2af6212c1bda04cb2350ef5ca9fec" and "8d7ca6ea0a8f8999233f1843a3df872e355ba517" have entirely different histories.
b977b7a4ec
...
8d7ca6ea0a
17
CHANGELOG.md
17
CHANGELOG.md
@ -29,21 +29,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- X10D: DateTime.Age(DateTime) and DateTimeOffset.Age(DateTimeOffset) parameter renamed from asOf to referenceDate.
|
||||
- X10D: `DateTime.Age(DateTime)` and `DateTimeOffset.Age(DateTimeOffset)` parameter renamed from `asOf` to `referenceDate`.
|
||||
|
||||
### Removed
|
||||
|
||||
- X10D: Removed `IEnumerable<T>.ConcatOne` - this functionality already exists with `Append`.
|
||||
|
||||
## [3.2.2] - 2023-06-05
|
||||
|
||||
### Added
|
||||
|
||||
- X10D.DSharpPlus: Added support for new usernames. See https://discord.com/blog/usernames
|
||||
|
||||
## 3.2.1 - 2023-06-05
|
||||
|
||||
ERRONEOUS RELEASE.
|
||||
- X10D: Removed `IEnumerable<T>.ConcatOne` - this functionality already exists with `Append`.
|
||||
|
||||
## [3.2.0] - 2023-04-03
|
||||
|
||||
@ -607,8 +597,7 @@ please [open an issue](https://github.com/oliverbooth/X10D/issues)!
|
||||
|
||||
Earlier versions of this package are undocumented and unlisted from package results.
|
||||
|
||||
[unreleased]: https://github.com/oliverbooth/X10D/compare/v3.2.2...main
|
||||
[3.2.2]: https://github.com/oliverbooth/X10D/releases/tag/v3.2.2
|
||||
[unreleased]: https://github.com/oliverbooth/X10D/compare/v3.2.0...main
|
||||
[3.2.0]: https://github.com/oliverbooth/X10D/releases/tag/v3.2.0
|
||||
[3.1.0]: https://github.com/oliverbooth/X10D/releases/tag/v3.1.0
|
||||
[3.0.0]: https://github.com/oliverbooth/X10D/releases/tag/v3.0.0
|
||||
|
@ -68,12 +68,6 @@ public static class DiscordUserExtensions
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
if (user.Discriminator == "0")
|
||||
{
|
||||
// user has a new username. see: https://discord.com/blog/usernames
|
||||
return user.Username;
|
||||
}
|
||||
|
||||
return $"{user.Username}#{user.Discriminator}";
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0"/>
|
||||
<PackageReference Include="NSubstitute" Version="5.0.0"/>
|
||||
<PackageReference Include="Moq" Version="4.18.4"/>
|
||||
<PackageReference Include="NUnit" Version="3.13.3"/>
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2"/>
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NSubstitute;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using X10D.Collections;
|
||||
|
||||
@ -13,17 +13,16 @@ public partial class CollectionTests
|
||||
[Test]
|
||||
public void ClearAndDisposeAll_ShouldClearAndDisposeAllItems_WhenCalledWithValidList()
|
||||
{
|
||||
var substitute1 = Substitute.For<IDisposable>();
|
||||
var substitute2 = Substitute.For<IDisposable>();
|
||||
var substitute3 = Substitute.For<IDisposable>();
|
||||
var list = new List<IDisposable> {substitute1, substitute2, substitute3};
|
||||
var mock1 = new Mock<IDisposable>();
|
||||
var mock2 = new Mock<IDisposable>();
|
||||
var mock3 = new Mock<IDisposable>();
|
||||
var list = new List<IDisposable> {mock1.Object, mock2.Object, mock3.Object};
|
||||
|
||||
list.ClearAndDisposeAll();
|
||||
|
||||
substitute1.Received(1).Dispose();
|
||||
substitute2.Received(1).Dispose();
|
||||
substitute3.Received(1).Dispose();
|
||||
|
||||
mock1.Verify(i => i.Dispose(), Times.Once);
|
||||
mock2.Verify(i => i.Dispose(), Times.Once);
|
||||
mock3.Verify(i => i.Dispose(), Times.Once);
|
||||
Assert.That(list, Is.Empty);
|
||||
}
|
||||
|
||||
@ -37,8 +36,8 @@ public partial class CollectionTests
|
||||
[Test]
|
||||
public void ClearAndDisposeAll_ShouldThrowInvalidOperationException_WhenCalledWithReadOnlyList()
|
||||
{
|
||||
var substitute = Substitute.For<IDisposable>();
|
||||
var list = new ReadOnlyCollection<IDisposable>(new List<IDisposable> {substitute});
|
||||
var mock = new Mock<IDisposable>();
|
||||
var list = new ReadOnlyCollection<IDisposable>(new List<IDisposable> {mock.Object});
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => list.ClearAndDisposeAll());
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using NSubstitute;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using X10D.Collections;
|
||||
|
||||
@ -13,17 +13,16 @@ public partial class CollectionTests
|
||||
[Test]
|
||||
public async Task ClearAndDisposeAllAsync_ShouldClearAndDisposeAllItems_WhenCalledWithValidList()
|
||||
{
|
||||
var substitute1 = Substitute.For<IAsyncDisposable>();
|
||||
var substitute2 = Substitute.For<IAsyncDisposable>();
|
||||
var substitute3 = Substitute.For<IAsyncDisposable>();
|
||||
var list = new List<IAsyncDisposable> {substitute1, substitute2, substitute3};
|
||||
var mock1 = new Mock<IAsyncDisposable>();
|
||||
var mock2 = new Mock<IAsyncDisposable>();
|
||||
var mock3 = new Mock<IAsyncDisposable>();
|
||||
var list = new List<IAsyncDisposable> {mock1.Object, mock2.Object, mock3.Object};
|
||||
|
||||
await list.ClearAndDisposeAllAsync().ConfigureAwait(false);
|
||||
|
||||
await substitute1.Received(1).DisposeAsync();
|
||||
await substitute2.Received(1).DisposeAsync();
|
||||
await substitute3.Received(1).DisposeAsync();
|
||||
|
||||
mock1.Verify(i => i.DisposeAsync(), Times.Once);
|
||||
mock2.Verify(i => i.DisposeAsync(), Times.Once);
|
||||
mock3.Verify(i => i.DisposeAsync(), Times.Once);
|
||||
Assert.That(list, Is.Empty);
|
||||
}
|
||||
|
||||
@ -37,8 +36,8 @@ public partial class CollectionTests
|
||||
[Test]
|
||||
public void ClearAndDisposeAllAsync_ShouldThrowInvalidOperationException_WhenCalledWithReadOnlyList()
|
||||
{
|
||||
var substitute = Substitute.For<IAsyncDisposable>();
|
||||
var list = new ReadOnlyCollection<IAsyncDisposable>(new List<IAsyncDisposable> {substitute});
|
||||
var mock = new Mock<IAsyncDisposable>();
|
||||
var list = new ReadOnlyCollection<IAsyncDisposable>(new List<IAsyncDisposable> {mock.Object});
|
||||
|
||||
Assert.ThrowsAsync<InvalidOperationException>(list.ClearAndDisposeAllAsync);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using NSubstitute;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using X10D.Collections;
|
||||
|
||||
@ -12,16 +12,16 @@ public partial class EnumerableTests
|
||||
[Test]
|
||||
public void DisposeAll_ShouldDisposeAllItems_WhenCalledWithValidList()
|
||||
{
|
||||
var substitute1 = Substitute.For<IDisposable>();
|
||||
var substitute2 = Substitute.For<IDisposable>();
|
||||
var substitute3 = Substitute.For<IDisposable>();
|
||||
var list = new List<IDisposable> { substitute1, substitute2, null!, substitute3 };
|
||||
var mock1 = new Mock<IDisposable>();
|
||||
var mock2 = new Mock<IDisposable>();
|
||||
var mock3 = new Mock<IDisposable>();
|
||||
var list = new List<IDisposable> {mock1.Object, mock2.Object, null!, mock3.Object};
|
||||
|
||||
list.DisposeAll();
|
||||
|
||||
substitute1.Received(1).Dispose();
|
||||
substitute2.Received(1).Dispose();
|
||||
substitute3.Received(1).Dispose();
|
||||
mock1.Verify(i => i.Dispose(), Times.Once);
|
||||
mock2.Verify(i => i.Dispose(), Times.Once);
|
||||
mock3.Verify(i => i.Dispose(), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -1,4 +1,4 @@
|
||||
using NSubstitute;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using X10D.Collections;
|
||||
|
||||
@ -12,16 +12,16 @@ public partial class EnumerableTests
|
||||
[Test]
|
||||
public async Task DisposeAllAsync_ShouldDisposeAllItems_WhenCalledWithValidList()
|
||||
{
|
||||
var substitute1 = Substitute.For<IAsyncDisposable>();
|
||||
var substitute2 = Substitute.For<IAsyncDisposable>();
|
||||
var substitute3 = Substitute.For<IAsyncDisposable>();
|
||||
var list = new List<IAsyncDisposable> { substitute1, substitute2, null!, substitute3 };
|
||||
var mock1 = new Mock<IAsyncDisposable>();
|
||||
var mock2 = new Mock<IAsyncDisposable>();
|
||||
var mock3 = new Mock<IAsyncDisposable>();
|
||||
var list = new List<IAsyncDisposable> {mock1.Object, mock2.Object, null!, mock3.Object};
|
||||
|
||||
await list.DisposeAllAsync().ConfigureAwait(false);
|
||||
|
||||
await substitute1.Received(1).DisposeAsync();
|
||||
await substitute2.Received(1).DisposeAsync();
|
||||
await substitute3.Received(1).DisposeAsync();
|
||||
mock1.Verify(i => i.DisposeAsync(), Times.Once);
|
||||
mock2.Verify(i => i.DisposeAsync(), Times.Once);
|
||||
mock3.Verify(i => i.DisposeAsync(), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Loading…
Reference in New Issue
Block a user