public void WhenProviderMetadataIsPassthrough_ProviderId_IsNotSet_OnHiveId() { // Arrange var metadata = new ProviderMetadata("test", new Uri("mappingroot://"), false, true); var originalId = new HiveId(1); // Act var newId = ProviderRepositoryHelper.CreateMappedProviderId(metadata, originalId); // Assert Assert.IsNull(newId.ProviderId); Assert.AreNotEqual(metadata.Alias, newId.ProviderId); }
public void WhenProviderMetadataIsNotPassthrough_ButProviderIdIsAlreadySet_ProviderId_IsNotOverriden_OnHiveId() { // Arrange var metadata = new ProviderMetadata("test", new Uri("mappingroot://"), false, false); var originalId = new HiveId(new Uri("myroot://"), "myprovider", new HiveIdValue(1)); // Act var newId = ProviderRepositoryHelper.CreateMappedProviderId(metadata, originalId); // Assert Assert.NotNull(newId.ProviderId); Assert.AreNotEqual(metadata.Alias, newId.ProviderId); Assert.AreEqual(originalId.ProviderId, newId.ProviderId); }