开发者

validate linqtosql mapping to a model

I have generated a LinqtoSQL mapping xml file, which I have a valid XSD schema that I check to m开发者_如何学Cake sure the XML is correct.

Now I want to check that the field type match the Model/Interface

for example:

checking that the nullable fields are nullable that int are int etc

anyone got any ideas if I can do this?


One way I have found is to just pass in a new object without setting anything:

[Test]
[Rollback]
public void Should_take_a_Document_with_nulls()
{
// Arrange
var repository = GetRepository();
var contact = new Contact();

// Act
repository.Save(contact);

// Assert
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜