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"); }
private (bool created, ArtistReport report) CallCreateReport(ArtistReportType reportType, int?versionNumber = null, Artist artist = null) { artist ??= _artist; var result = _queries.CreateReport(artist.Id, reportType, "39.39.39.39", "It's Miku, not Rin", versionNumber); var report = _repository.Load <ArtistReport>(result.reportId); return(result.created, report); }