Exemplo n.º 1
0
        public void IsNotNewNegativeTest()
        {
            var spec     = new IsNotNewSpecification <CompetitionAggregate>();
            var isNotNew = spec.IsSatisfiedBy(new CompetitionAggregate(CompetitionId.New, SnapshotNeverStrategy.Default));

            isNotNew.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void IsNotNewPositiveTest()
        {
            var spec        = new IsNotNewSpecification <CompetitionAggregate>();
            var competition = new CompetitionAggregate(CompetitionId.New, SnapshotNeverStrategy.Default);

            competition.ApplyEvents(ToDomainEvents(competition.Id, new CompetitionRegisteredEvent("user", "name")));
            var isNotNew = spec.IsSatisfiedBy(competition);

            isNotNew.Should().BeTrue();
        }