本文整理汇总了C#中StandardKernel.Load方法的典型用法代码示例。如果您正苦于以下问题:C# StandardKernel.Load方法的具体用法?C# StandardKernel.Load怎么用?C# StandardKernel.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StandardKernel
的用法示例。
在下文中一共展示了StandardKernel.Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
IKernel kernel = new StandardKernel(new NinjectSettings {LoadExtensions = false});
kernel.Load(new LinFuModule());
kernel.Load(new TransactionalAnnotationTestModule());
_targetService = kernel.Get<ITargetService>();
_interceptor = (TestTransactionInterceptor) kernel.Get<ITransactionInterceptor>();
}
示例2: IsNotOnGroundWhenNoEntities
public void IsNotOnGroundWhenNoEntities()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
kernel.Load<ProtogamePlatformingIoCModule>();
var platforming = kernel.Get<IPlatforming>();
_assert.False(platforming.IsOnGround(
this.CreateBoundingBox(200, 200, 16, 16),
new IBoundingBox[0],
x => true));
}
示例3: IsNotOnGroundWhenOnlyEntity
public void IsNotOnGroundWhenOnlyEntity()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
kernel.Load<ProtogamePlatformingIoCModule>();
var platforming = kernel.Get<IPlatforming>();
var entity = this.CreateBoundingBox(200, 200, 16, 16);
_assert.False(platforming.IsOnGround(
entity,
new[] { entity },
x => true));
}
示例4: IsNotOnGroundWhenJustAboveTheGround
public void IsNotOnGroundWhenJustAboveTheGround()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
kernel.Load<ProtogamePlatformingIoCModule>();
var platforming = kernel.Get<IPlatforming>();
var player = this.CreateBoundingBox(200, 200 - 17, 16, 16);
var ground = this.CreateBoundingBox(0, 200, 400, 16);
_assert.False(platforming.IsOnGround(
player,
new[] { player, ground },
x => true));
}
示例5: IsNotOverlappingWhenNoBoundingBoxes
public void IsNotOverlappingWhenNoBoundingBoxes()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
_assert.False(boundingBoxUtilities.Overlaps());
}
示例6: IsNotOverlappingWhenOneBoundingBox
public void IsNotOverlappingWhenOneBoundingBox()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
_assert.False(boundingBoxUtilities.Overlaps(this.CreateBoundingBox(200, 200, 16, 16)));
}
示例7: ReplaceMapper
public void ReplaceMapper() {
var c = new StandardKernel();
var mapper = new global::SolrNet.Tests.Mocks.MReadOnlyMappingManager();
c.Load(new SolrNetModule("http://localhost:8983/solr") {Mapper = mapper});
var m = c.Get<IReadOnlyMappingManager>();
Assert.AreSame(mapper, m);
}
示例8: IsNotOverlappingWhenSameBoundingBoxAndNoOtherBoxes
public void IsNotOverlappingWhenSameBoundingBoxAndNoOtherBoxes()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
var entity = this.CreateBoundingBox(200, 200, 16, 16);
_assert.False(boundingBoxUtilities.Overlaps(entity, entity));
}
示例9: CreateKernel
protected override IKernel CreateKernel()
{
var kernel = new StandardKernel();
kernel.Load<PersistenceModule>();
return kernel;
}
示例10: Ping_And_Query
public void Ping_And_Query()
{
var c = new StandardKernel();
c.Load(new SolrNetModule("http://localhost:8983/solr"));
var solr = c.Get<ISolrOperations<Entity>>();
solr.Ping();
Console.WriteLine(solr.Query(SolrQuery.All).Count);
}
示例11: ReplaceMapper
public void ReplaceMapper()
{
var c = new StandardKernel();
var mapper = MockRepository.GenerateMock<IReadOnlyMappingManager>();
c.Load(new SolrNetModule("http://localhost:8983/solr") {Mapper = mapper});
var m = c.Get<IReadOnlyMappingManager>();
Assert.AreSame(mapper, m);
}
示例12: IsOverlappingWhenDifferentBoundingBoxes
public void IsOverlappingWhenDifferentBoundingBoxes()
{
var kernel = new StandardKernel();
kernel.Load<ProtogameCoreModule>();
var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
_assert.True(boundingBoxUtilities.Overlaps(
this.CreateBoundingBox(200, 200, 16, 16),
this.CreateBoundingBox(200, 200, 16, 16)));
}
示例13: Main
static void Main(string[] args)
{
IKernel _Kernal = new StandardKernel();
_Kernal.Load(Assembly.GetExecutingAssembly());
ISMSService _SMSService = _Kernal.Get<ISMSService>();
UIHandler _UIHandler = new UIHandler(_SMSService);
_UIHandler.SendConfirmationMsg("96279544480");
Console.ReadLine();
}
示例14: ConventionsCanBeUsedInModules
public void ConventionsCanBeUsedInModules()
{
using (IKernel kernel = new StandardKernel())
{
kernel.Load<TestModule>();
var instance = kernel.Get<IDefaultConvention>();
instance.Should().NotBeNull();
instance.Should().BeOfType<DefaultConvention>();
}
}
示例15: SetUp
public void SetUp()
{
IKernel kernel = new StandardKernel(new NinjectSettings { LoadExtensions = false });
kernel.Load(new LinFuModule());
kernel.Load(new TransactionsModule());
// TODO externalise the test database connection information
IDbProvider dbProvider = DbProviderFactory.GetDbProvider("MySql.Data.MySqlClient");
dbProvider.ConnectionString = "SERVER=localhost; DATABASE=chameleon; UID=root; PASSWORD=;";
kernel.Bind<IDbProvider>().ToConstant(dbProvider).InSingletonScope();
_adoTemplate = kernel.Get<AdoTemplate>();
_service = kernel.Get<Service>();
_adoTemplate.ExecuteNonQuery(CommandType.Text,
"CREATE TABLE IF NOT EXISTS TransactionIntegrationTest ("
+ " id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, "
+ " `name` VARCHAR(100)" + ");"
+ "TRUNCATE TABLE TransactionIntegrationTest;");
}