public void Create() { var result = queries.Create(newArtistContract); Assert.IsNotNull(result, "result"); Assert.AreEqual("Tripshots", result.Name, "Name"); artist = repository.Load(result.Id); Assert.IsNotNull(artist, "Artist was saved to repository"); Assert.AreEqual("Tripshots", artist.DefaultName, "Name"); Assert.AreEqual(ContentLanguageSelection.English, artist.Names.SortNames.DefaultLanguage, "Default language should be English"); Assert.AreEqual(1, artist.WebLinks.Count, "Weblinks count"); var archivedVersion = repository.List <ArchivedArtistVersion>().FirstOrDefault(); Assert.IsNotNull(archivedVersion, "Archived version was created"); Assert.AreEqual(artist, archivedVersion.Artist, "Archived version artist"); Assert.AreEqual(ArtistArchiveReason.Created, archivedVersion.Reason, "Archived version reason"); var activityEntry = repository.List <ActivityEntry>().FirstOrDefault(); Assert.IsNotNull(activityEntry, "Activity entry was created"); Assert.AreEqual(artist, activityEntry.EntryBase, "Activity entry's entry"); Assert.AreEqual(EntryEditEvent.Created, activityEntry.EditEvent, "Activity entry event type"); }
public async Task Create() { var result = await _queries.Create(_newArtistContract); result.Should().NotBeNull("result"); result.Name.Should().Be("Tripshots", "Name"); _artist = _repository.Load(result.Id); _artist.Should().NotBeNull("Artist was saved to repository"); _artist.DefaultName.Should().Be("Tripshots", "Name"); _artist.Names.SortNames.DefaultLanguage.Should().Be(ContentLanguageSelection.English, "Default language should be English"); _artist.WebLinks.Count.Should().Be(1, "Weblinks count"); var archivedVersion = _repository.List <ArchivedArtistVersion>().FirstOrDefault(); archivedVersion.Should().NotBeNull("Archived version was created"); archivedVersion.Artist.Should().Be(_artist, "Archived version artist"); archivedVersion.Reason.Should().Be(ArtistArchiveReason.Created, "Archived version reason"); var activityEntry = _repository.List <ActivityEntry>().FirstOrDefault(); activityEntry.Should().NotBeNull("Activity entry was created"); activityEntry.EntryBase.Should().Be(_artist, "Activity entry's entry"); activityEntry.EditEvent.Should().Be(EntryEditEvent.Created, "Activity entry event type"); }