/Framework/src/Ncqrs.Tests/Domain/AggregateRootMappedWithAttributesTests.cs
C# | 27 lines | 24 code | 3 blank | 0 comment | 0 complexity | 532cabc88ad2730326270d7b3a492be4 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, Apache-2.0
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using FluentAssertions;
- using Ncqrs.Domain;
- using Ncqrs.Eventing.Sourcing.Mapping;
- using Xunit;
- using Rhino.Mocks;
-
- namespace Ncqrs.Tests.Domain
- {
-
- public class AggregateRootMappedWithAttributesTests
- {
- [Fact]
- public void Initializing_one_should_set_the_mapping_strategy_to_attributed_based()
- {
- var aggregateRoot = MockRepository.GenerateMock<AggregateRootMappedWithAttributes>();
- var field = aggregateRoot.GetType().BaseType.BaseType.GetField("_mappingStrategy", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField);
-
- var theStrategy = field.GetValue(aggregateRoot);
- theStrategy.Should().BeOfType<AttributeBasedEventHandlerMappingStrategy>();
- }
- }
- }