コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
		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));
		}
コード例 #4
0
		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);
		}