本文整理汇总了C#中IOrganizationRepository.GetDefaultOrganization方法的典型用法代码示例。如果您正苦于以下问题:C# IOrganizationRepository.GetDefaultOrganization方法的具体用法?C# IOrganizationRepository.GetDefaultOrganization怎么用?C# IOrganizationRepository.GetDefaultOrganization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOrganizationRepository
的用法示例。
在下文中一共展示了IOrganizationRepository.GetDefaultOrganization方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUpController
/// TODO: Dig a little deeper into the SaveFiles method to test some more use cases...
/// * What if a single upload fails
/// * What if 1 of 3 fails
/// * What if 3 of 3 fails
/// * etc...
private void SetUpController()
{
organizationRepository = new FakeOrganizationRepository();
causeTemplateRepository = new FakeCauseTemplateRepository();
causeRepository = new FakeCauseRepository();
controller = new CauseTemplateController(causeTemplateRepository, causeRepository)
{
OrganizationRepository = organizationRepository
};
TestHelpers.MockBasicRequest(controller);
organization = organizationRepository.GetDefaultOrganization();
organization.CauseTemplates.Add(EntityHelpers.GetValidCauseTemplate());
}
示例2: GetController
/// TODO: Dig a little deeper into the SaveFiles method to test some more use cases...
/// * What if a single upload fails
/// * What if 1 of 3 fails
/// * What if 3 of 3 fails
/// * etc...
private CauseTemplateController GetController(bool isAuthenticated = false, bool postFiles = true)
{
organizationRepository = new FakeOrganizationRepository();
causeTemplateRepository = new FakeCauseTemplateRepository();
causeRepository = mocks.DynamicMock<ICauseRepository>();
Expect.Call(causeRepository.GetCauseByCauseTemplateIdAndReferenceNumber(-1, "")).IgnoreArguments()
.Return(EntityHelpers.GetValidCause());
var causeTemplateController = new CauseTemplateController(causeTemplateRepository, causeRepository);
organization = organizationRepository.GetDefaultOrganization();
organization.CauseTemplates = new List<CauseTemplate> { EntityHelpers.GetValidCauseTemplate() };
TestHelpers.MockHttpContext(causeTemplateController, mocks, isAuthenticated, postFiles);
return causeTemplateController;
}