Skip to content

Instantly share code, notes, and snippets.

@egomesbrandao
Created April 12, 2011 17:50
Show Gist options
  • Save egomesbrandao/916016 to your computer and use it in GitHub Desktop.
Save egomesbrandao/916016 to your computer and use it in GitHub Desktop.
Public Class Fornecedor
Implements IContrato
End Class
Public Interface IContrato
End Interface
Imports Ninject.Modules
Public Class Modulo
Inherits NinjectModule
Public Overrides Sub Load()
Bind(Of IContrato).To(Of Fornecedor)()
End Sub
End Class
<TestClass()> Public Class NinjectTest
<TestMethod()> _
Public Sub TestMethod1()
Dim modulo As New Modulo()
Dim kernel As IKernel = New StandardKernel(modulo)
Dim meuContrato As IContrato = kernel.Get(Of IContrato)()
Assert.IsNotNull(meuContrato)
Assert.IsInstanceOfType(meuContrato, GetType(Fornecedor))
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment