public void GetBoundConstructor_ReturnsParameterlessConstructor_ForTypeWithMultipleConstructors() { // Arrange var type = typeof(NonPublicParameterlessConstructorType); // Act var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); // Assert Assert.Null(result); }
public void GetBoundConstructor_ParameterlessConstructor_ReturnsNull() { // Arrange var type = typeof(ParameterlessConstructorType); // Act var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); // Assert Assert.Null(result); }
public void GetBoundConstructor_ReturnsPrimaryConstructor_ForRecordType() { // Arrange var type = typeof(RecordTypeWithPrimaryConstructor); // Act var result = DefaultBindingMetadataProvider.GetBoundConstructor(type); // Assert Assert.NotNull(result); Assert.Collection( result.GetParameters(), p => Assert.Equal("name", p.Name)); }