public void SetContributors_TwoContributors_IncludedInMetsData() { var contributors = new ContributionCollection(); OlacSystem olacSystem = new OlacSystem(); contributors.Add(new Contribution("Erkel", olacSystem.GetRoleByCodeOrThrow("author"))); contributors.Add(new Contribution("Sungfu", olacSystem.GetRoleByCodeOrThrow("recorder"))); _helper.SetContributors(contributors); var data = _helper.GetMetadata(); Assert.AreEqual("{\"dc.title\":\"Test Title\",\"" + RampArchivingDlgViewModel.kContributor + "\":{\"0\":{\" \":\"Erkel\",\"role\":\"author\"},\"1\":{\" \":\"Sungfu\",\"role\":\"recorder\"}}}", data); }
public void SetContributors_SetTwice_ThrowsInvalidOperationException() { var contributors = new ContributionCollection(); OlacSystem olacSystem = new OlacSystem(); Role role = olacSystem.GetRoleByCodeOrThrow("author"); var contrib = new Contribution("Erkel", role); contributors.Add(contrib); _helper.SetContributors(contributors); Assert.Throws <InvalidOperationException>(() => _helper.SetContributors(contributors)); }
public void SetContributors_SetTwice_ThrowsInvalidOperationException() { var contributors = new ContributionCollection(); OlacSystem olacSystem = new OlacSystem(); Role role = olacSystem.GetRoleByCodeOrThrow("author"); var contrib = new Contribution("Erkel", role); contributors.Add(contrib); _helper.SetContributors(contributors); Assert.Throws<InvalidOperationException>(() => _helper.SetContributors(contributors)); }
public void SetContributors_TwoContributors_IncludedInMetsData() { var contributors = new ContributionCollection(); OlacSystem olacSystem = new OlacSystem(); contributors.Add(new Contribution("Erkel", olacSystem.GetRoleByCodeOrThrow("author"))); contributors.Add(new Contribution("Sungfu", olacSystem.GetRoleByCodeOrThrow("recorder"))); _helper.SetContributors(contributors); var data = _helper.GetMetadata(); Assert.AreEqual("{\"dc.title\":\"Test Title\",\"" + RampArchivingDlgViewModel.kContributor + "\":{\"0\":{\" \":\"Erkel\",\"role\":\"author\"},\"1\":{\" \":\"Sungfu\",\"role\":\"recorder\"}}}", data); }