Example #1
0
		public void RequiredTest()
		{
			ImportAttribute importAttribute = new ImportAttribute { Required = false };

			ImportAttributeInfo info =
				importAttribute.ProvideImportInfo(typeof(IBasicService), "Property");

			Assert.NotNull(info);
			Assert.Null(info.ImportName);
			Assert.Null(info.ImportKey);
			Assert.False(info.IsRequired);
		}
Example #2
0
		public void ImportKeyTest()
		{
			ImportAttribute importAttribute = new ImportAttribute { Key = 5 };

			ImportAttributeInfo info =
				importAttribute.ProvideImportInfo(typeof(IBasicService), "Property");

			Assert.NotNull(info);
			Assert.Null(info.ImportName);
			Assert.Equal(5, info.ImportKey);
			Assert.True(info.IsRequired);
		}
Example #3
0
		public void NameImportTest()
		{
			string name = "TestName";
			ImportAttribute importAttribute = new ImportAttribute { Name = name };

			ImportAttributeInfo info =
				importAttribute.ProvideImportInfo(typeof(IBasicService), "Property");

			Assert.NotNull(info);
			Assert.Equal(name, info.ImportName);
			Assert.Null(info.ImportKey);
			Assert.True(info.IsRequired);
		}