public void Should_CreateGraphMetadata_WhenGraphBasedTypeHandle() { //Arrange var typeMetadataFactoryMock = GetMockedTypeMetadataFactory(); var graphMetadataFactoryMock = GetMockedGraphMetadataFactory(); var factory = new TypeHandleMetadataFactory(typeMetadataFactoryMock.Object, graphMetadataFactoryMock.Object); //Act var graphBasedMetadata = factory.Create(s_GraphBasedHandle); //Assert Assert.That(graphBasedMetadata, Is.SameAs(k_GraphBasedMetadata)); graphMetadataFactoryMock.Verify(f => f.Create(It.IsAny <TypeHandle>()), Times.Exactly(1)); }
public void Should_CreateEmptyMetadata_WhenEmptyTypeHandle() { //Arrange var typeMetadataFactoryMock = GetMockedTypeMetadataFactory(); var graphMetadataFactoryMock = GetMockedGraphMetadataFactory(); var factory = new TypeHandleMetadataFactory(typeMetadataFactoryMock.Object, graphMetadataFactoryMock.Object); //Act var emptyMetadata = factory.Create(default(TypeHandle)); //Assert graphMetadataFactoryMock.Verify(f => f.Create(It.IsAny <TypeHandle>()), Times.Exactly(0)); typeMetadataFactoryMock.Verify(f => f.Create(It.IsAny <TypeHandle>()), Times.Exactly(0)); Assert.That(emptyMetadata, Is.SameAs(EmptyTypeMetadata.Instance)); }