public void WeakMixedDto() { IDtoInfo info = DtoInfo.GetInfo(typeof(MixedDto)); info.CreateNew().Should().BeEquivalentTo(new MixedDto()); info.CreateNew(("string", "hey")).Should().BeEquivalentTo(new MixedDto { String = "hey" }); info.CreateNew(("integer", 1), ("string", "wow")).Should().BeEquivalentTo(new MixedDto(1) { String = "wow" }); }
public void OnePropertyWeakInfoTests() { IDtoInfo info = DtoInfo.GetInfo(typeof(OneProperty)); info.Properties.Count.Should().Be(1); info.CreateNew().GetType().Should().Be(typeof(OneProperty)); OneProperty dto = new() { Integer = 42 }; ((OneProperty)info.ShallowClone(dto)).Integer.Should().Be(dto.Integer); info.GetProperty("Integer").Name.Should().Be("Integer"); info.TryGetProperty("Integer") !.Name.Should().Be("Integer"); info.GetProperty("integer").Name.Should().Be("Integer"); info.TryGetProperty("integer") !.Name.Should().Be("Integer"); }