示例#1
0
        public void ChangeTypeWhenTitleIsNullOrEmptyShouldRaiseArgumentNullAggregateException(string newType)
        {
            //Arrange
            var title       = new Title("Lorem Ipsum is simply dummy text of the printin");
            var description = new Description(@"Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                                              Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took ");
            var url         = new UrlValue("http://url.com");

            var speech = new SpeechAggregate.Speech(title, url, description, SpeechType.Conferences);

            //Act
            //Assert
            Assert.Throws <InvalidEnumAggregateException>(() => speech.ChangeType(new SpeechType(newType), It.IsAny <long>()));
        }
示例#2
0
        public void ChangeTypeWhenExpectedVersionIsNotEqualsToAggregateVersionShouldRaiseConcurrencyException()
        {
            //Arrange
            long   expectedVersion = 1;
            string newType         = "Conferences";
            var    title           = new Title("Lorem Ipsum is simply dummy text of the printin");
            var    description     = new Description(@"Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                                              Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took ");
            var    url             = new UrlValue("http://url.com");

            var speech = new SpeechAggregate.Speech(title, url, description, SpeechType.Conferences);

            //Act
            //Assert
            Assert.Throws <ConcurrencyException>(() => speech.ChangeType(new SpeechType(newType), expectedVersion));
        }
示例#3
0
        public void ChangeTypeWithValidArgumentsShouldApplySpeechTypeChangedEvent()
        {
            //Arrange
            long   expectedVersion = 0;
            string newType         = "Conferences";
            var    title           = new Title("Lorem Ipsum is simply dummy text of the printin");
            var    description     = new Description(@"Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                                              Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took ");
            var    url             = new UrlValue("http://url.com");

            var speech = new SpeechAggregate.Speech(title, url, description, SpeechType.Conferences);

            //Act
            speech.ChangeType(new SpeechType(newType), expectedVersion);

            //Assert
            Assert.Equal(newType, speech.Type.StringValue);
            Assert.Equal(description, speech.Description);
            Assert.Equal(url, speech.Url);
        }