Line data Source code
1 : using System;
2 : using cdmdotnet.Logging;
3 : using Cqrs.Domain;
4 : using Cqrs.Domain.Exceptions;
5 : using Cqrs.Domain.Factories;
6 : using Cqrs.Authentication;
7 : using Cqrs.Tests.Substitutes;
8 : using NUnit.Framework;
9 :
10 : namespace Cqrs.Tests.Domain
11 : {
12 : [TestFixture]
13 : public class When_getting_aggregate_without_contructor
14 0 : {
15 : private IUnitOfWork<ISingleSignOnToken> _unitOfWork;
16 :
17 : [SetUp]
18 0 : public void Setup()
19 : {
20 : var eventStore = new TestEventStore();
21 : var dependencyResolver = new TestDependencyResolver(eventStore);
22 : var aggregateFactory = new AggregateFactory(dependencyResolver, dependencyResolver.Resolve<ILogger>());
23 : var eventPublisher = new TestEventPublisher();
24 : _unitOfWork = new UnitOfWork<ISingleSignOnToken>(new Repository<ISingleSignOnToken>(aggregateFactory, eventStore, eventPublisher, new NullCorrelationIdHelper()));
25 : }
26 :
27 : /*
28 : * I don't think this makes sense anymore as it tests the test dependency resolver... test code testing test code.
29 : [Test]
30 : public void Should_throw_missing_parameterless_constructor_exception()
31 : {
32 : Assert.Throws<MissingParameterLessConstructorException>(() => _unitOfWork.Get<TestAggregateNoParameterLessConstructor>(Guid.NewGuid()));
33 : }
34 : */
35 : }
36 : }
|