Skip to content

Commit

Permalink
chore: unpass unit test for RegSvcBgTaskTests
Browse files Browse the repository at this point in the history
  • Loading branch information
catcherwong committed Aug 7, 2022
1 parent 22537b7 commit 76463ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Nacos.AspNetCore.Tests/RegSvcBgTaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task StartAsync_RegisterInstance_Should_Call_Only_Once()
{
_mockServer.Setup(x => x.Features).Returns(new FeatureCollection());
_mockSvc.Setup(x => x.RegisterInstance(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Instance>())).Returns(Task.CompletedTask);
_mockOptions.Setup(x => x.CurrentValue).Returns(new NacosAspNetOptions { ServiceName = "abc123" });
_mockOptions.Setup(x => x.CurrentValue).Returns(new NacosAspNetOptions { ServiceName = "abc123", Ip = "127.0.0.1" });

var task = new RegSvcBgTask(NullLoggerFactory.Instance, _mockSvc.Object, _mockServer.Object, _mockOptions.Object);
await task.StartAsync(default).ConfigureAwait(false);
Expand All @@ -46,7 +46,7 @@ public async Task StartAsync_RegisterInstance_Should_Call_AtMost_Three_Times()
{
_mockServer.Setup(x => x.Features).Returns(new FeatureCollection());
_mockSvc.Setup(x => x.RegisterInstance(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Instance>())).Throws<Exception>();
_mockOptions.Setup(x => x.CurrentValue).Returns(new NacosAspNetOptions { ServiceName = "abc123" });
_mockOptions.Setup(x => x.CurrentValue).Returns(new NacosAspNetOptions { ServiceName = "abc123", Ip = "127.0.0.1" });

var task = new RegSvcBgTask(NullLoggerFactory.Instance, _mockSvc.Object, _mockServer.Object, _mockOptions.Object);
await task.StartAsync(default).ConfigureAwait(false);
Expand Down

0 comments on commit 76463ef

Please sign in to comment.