diff --git a/Shared.EventStore.Tests/DomainEventHelperTests.cs b/Shared.EventStore.Tests/DomainEventHelperTests.cs index 981ef7c..36b1dd0 100644 --- a/Shared.EventStore.Tests/DomainEventHelperTests.cs +++ b/Shared.EventStore.Tests/DomainEventHelperTests.cs @@ -4,56 +4,56 @@ using System.Text; using System.Threading.Tasks; -namespace Shared.Tests -{ - using DomainDrivenDesign.EventSourcing; - using EventStore.Tests; - using Shared.EventStore.Tests.TestObjects; - using Shouldly; - using Xunit; +namespace Shared.Tests; + +using DomainDrivenDesign.EventSourcing; +using EventStore.Tests; +using Shared.EventStore.Tests.TestObjects; +using Shouldly; +using Xunit; - public class DomainEventHelperTests +public class DomainEventHelperTests +{ + [Fact] + public void DomainEventHelper_GetProperty_CorrectCase_PropertyNotFound() { - [Fact] - public void DomainEventHelper_GetProperty_CorrectCase_PropertyNotFound() - { - AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); - String propertyValue = DomainEventHelper.GetProperty(domainEvent, "AggregateName1"); - propertyValue.ShouldBe(default); - } + AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); + String propertyValue = DomainEventHelper.GetProperty(domainEvent, "AggregateName1"); + propertyValue.ShouldBe(default); + } - [Theory] - [InlineData("AggregateName1")] - [InlineData("aggregatename1")] - [InlineData("AGGREGATENAME1")] - public void DomainEventHelper_GetProperty_IgnoreCase_PropertyNotFound(String propertyName) - { + [Theory] + [InlineData("AggregateName1")] + [InlineData("aggregatename1")] + [InlineData("AGGREGATENAME1")] + public void DomainEventHelper_GetProperty_IgnoreCase_PropertyNotFound(String propertyName) + { - AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); - String propertyValue = DomainEventHelper.GetProperty(domainEvent, propertyName, true); - propertyValue.ShouldBe(default); - } + AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); + String propertyValue = DomainEventHelper.GetProperty(domainEvent, propertyName, true); + propertyValue.ShouldBe(default); + } - [Fact] - public void DomainEventHelper_GetProperty_CorrectCase_PropertyFound(){ + [Fact] + public void DomainEventHelper_GetProperty_CorrectCase_PropertyFound(){ - AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); - String propertyValue = DomainEventHelper.GetProperty(domainEvent, "AggregateName"); - propertyValue.ShouldBe(TestData.EstateName); - } + AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); + String propertyValue = DomainEventHelper.GetProperty(domainEvent, "AggregateName"); + propertyValue.ShouldBe(TestData.EstateName); + } - [Theory] - [InlineData("AggregateName")] - [InlineData("aggregatename")] - [InlineData("AGGREGATENAME")] - public void DomainEventHelper_GetProperty_IgnoreCase_PropertyFound(String propertyName) - { + [Theory] + [InlineData("AggregateName")] + [InlineData("aggregatename")] + [InlineData("AGGREGATENAME")] + public void DomainEventHelper_GetProperty_IgnoreCase_PropertyFound(String propertyName) + { - AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); - String propertyValue = DomainEventHelper.GetProperty(domainEvent, propertyName, true); - propertyValue.ShouldBe(TestData.EstateName); - } + AggregateNameSetEvent domainEvent = new(TestData.AggregateId, TestData.EventId, TestData.EstateName); + String propertyValue = DomainEventHelper.GetProperty(domainEvent, propertyName, true); + propertyValue.ShouldBe(TestData.EstateName); + } [Theory] [InlineData("AggregateName", true)] @@ -69,4 +69,3 @@ public void DomainEventHelper_HasProperty_ExpectedResultReturned(String property } } -} diff --git a/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs b/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs index caf1bb2..367d5f9 100644 --- a/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs +++ b/Shared.EventStore.Tests/SubscriptionRepositoryTests.cs @@ -1,33 +1,32 @@ using Shared.EventStore.Tests.TestObjects; -namespace Shared.EventStore.Tests -{ - using System; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Shouldly; - using SubscriptionWorker; - using Xunit; - - public class SubscriptionRepositoryTests - { - #region Methods +namespace Shared.EventStore.Tests; + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Shouldly; +using SubscriptionWorker; +using Xunit; - [Fact] - public async Task SubscriptionRepository_GetSubscriptions_ReturnsSubscriptions() - { - List allSubscriptions = (TestData.GetPersistentSubscriptions_DemoEstate()); +public class SubscriptionRepositoryTests +{ + #region Methods - Func>> GetAllSubscriptions = async token => allSubscriptions; + [Fact] + public async Task SubscriptionRepository_GetSubscriptions_ReturnsSubscriptions() + { + List allSubscriptions = (TestData.GetPersistentSubscriptions_DemoEstate()); - ISubscriptionRepository subscriptionRepository = SubscriptionRepository.Create(GetAllSubscriptions); + Func>> GetAllSubscriptions = async token => allSubscriptions; - PersistentSubscriptions list = await subscriptionRepository.GetSubscriptions(true, CancellationToken.None); + ISubscriptionRepository subscriptionRepository = SubscriptionRepository.Create(GetAllSubscriptions); - list.PersistentSubscriptionInfo.Count.ShouldBe(allSubscriptions.Count); - } + PersistentSubscriptions list = await subscriptionRepository.GetSubscriptions(true, CancellationToken.None); - #endregion + list.PersistentSubscriptionInfo.Count.ShouldBe(allSubscriptions.Count); } + + #endregion } \ No newline at end of file