本文整理汇总了C#中IProjectRepository.Get方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectRepository.Get方法的具体用法?C# IProjectRepository.Get怎么用?C# IProjectRepository.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProjectRepository
的用法示例。
在下文中一共展示了IProjectRepository.Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
_autoSubstitute = AutoSubstituteContainer.Create();
_projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
_dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
_controller = _autoSubstitute.GetController<ConfirmController>();
_lookup = _autoSubstitute.Resolve<ICurtinUserService>();
var user = CreateUser("XX12345");
var dmp = Builder<DataManagementPlan>.CreateNew()
.With(o => o.NewDataDetail = Builder<NewDataDetail>.CreateNew().Build())
.And(o => o.ExistingDataDetail = Builder<ExistingDataDetail>.CreateNew().Build())
.And(o => o.DataSharing = Builder<DataSharing>.CreateNew().Build())
.And(o => o.DataRelationshipDetail = Builder<DataRelationshipDetail>.CreateNew().Build())
.Build();
var dd = Builder<DataDeposit>.CreateNew().Build();
_project = Builder<Project>.CreateNew()
.With(o => o.DataManagementPlan = dmp)
.And(o => o.DataDeposit = dd)
.And(p => p.Description = "TestProject")
.And(o => o.Keywords = "1,2,3,4,5,6,7,8,9,10,11,12")
.Build();
_project.FieldsOfResearch.AddRange(Builder<ProjectFieldOfResearch>
.CreateListOfSize(5)
.All()
.With(p => p.FieldOfResearch = Builder<FieldOfResearch>.CreateNew().Build())
.Build());
_project.SocioEconomicObjectives.AddRange(Builder<ProjectSocioEconomicObjective>
.CreateListOfSize(7)
.All()
.With(p => p.SocioEconomicObjective = Builder<SocioEconomicObjective>.CreateNew().Build())
.Build());
_project.Parties.AddRange(Builder<ProjectParty>.CreateListOfSize(8)
.TheFirst(1)
.With(o => o.Role = AccessRole.Members)
.And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).Build())
.TheNext(1)
.With(o => o.Role = AccessRole.Owners)
.And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).And(p => p.UserId = user.CurtinId).Build())
.And(o => o.Relationship = ProjectRelationship.PrincipalInvestigator)
.TheNext(1)
.With(o => o.Role = AccessRole.Visitors)
.And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).Build())
.TheNext(1)
.With(o => o.Role = AccessRole.None)
.And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).Build())
.TheNext(1)
.With(o => o.Role = AccessRole.Members)
.And(
o =>
o.Party =
Builder<Party>.CreateNew().With(p => p.UserId = "FF24587").Build())
.TheNext(1)
.With(o => o.Role = AccessRole.Visitors)
.And(
o =>
o.Party =
Builder<Party>.CreateNew().With(p => p.UserId = "GA37493").Build())
.TheNext(1)
.With(o => o.Role = AccessRole.None)
.And(
o =>
o.Party =
Builder<Party>.CreateNew().With(p => p.UserId = "KK25344").Build())
.TheNext(1)
.With(o => o.Role = AccessRole.Owners)
.And(
o =>
o.Party =
Builder<Party>.CreateNew().With(p => p.UserId = "DD25265").Build())
.Build());
_bus = _autoSubstitute.Resolve<IBus>();
_projectRepository.Get(Arg.Is(_project.Id)).Returns(_project);
_projectRepository.GetByDataManagementPlanId(Arg.Is(_project.DataManagementPlan.Id)).Returns(_project);
var resolver = Substitute.For<IDependencyResolver>();
DependencyResolver.SetResolver(resolver);
}