Created
October 10, 2011 08:34
-
-
Save codereflection/1274872 to your computer and use it in GitHub Desktop.
In line XML in VB - perhaps it's only redeeming quality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports Xunit | |
Imports System.Linq | |
Imports System.Dynamic | |
Imports Simple.Data.Mocking | |
Public Class Mockz | |
<Fact()> | |
Public Sub MockMockMock() | |
Dim mockAdapter As New XmlMockAdapter(<Root> | |
<Cats Age="System.Int32"> | |
<Cat Name="Jewelz" Age="1"/> | |
<Cat Name="Barfly" Age="2"/> | |
</Cats> | |
</Root>) | |
MockHelper.UseMockAdapter(mockAdapter) | |
Dim Cats = Database.Default.Cats.All().ToList() | |
Assert.Equal(2, Cats.Count()) | |
Assert.Equal("Jewelz", Database.Default.Cats.FindByName("Jewelz").Name) | |
Assert.Equal(2, Database.Default.Cats.FindByAge(2).Age) | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh dear. o_O