コード例 #1
0
        public void Paths_Update_StatusCode_400(int status)
        {
            IPathRepository  pathRepository  = null;
            IPointRepository pointRepository = null;

            PathsController controller = new PathsController(pathRepository, pointRepository);

            Path path = new Path()
            {
                Destiny = new Point()
                {
                    Name = "A"
                },
                Origin = new Point()
                {
                    Name = "B"
                }
            };

            IActionResult actionResult = controller.PutPath(path.PathId, path);

            int?statusCode = ((BadRequestObjectResult)(actionResult.Should().Subject)).StatusCode;

            statusCode.Should().Be(status, $"StatusCode should be {status}");
        }
コード例 #2
0
        public RoutesController(IPathRepository pathRepository, IPointRepository pointRepository, IRouteRepository routeRepository)
        {
            _pathRepository  = pathRepository;
            _pointRepository = pointRepository;
            _routeRepository = routeRepository;

            _routes = BuildRutes();
        }
コード例 #3
0
 public TreeUtilities(IHebrewLetterRepository hebrewLetterRepository, ISephiraRepository sephiraRepository,
     IPlanetRepository planetRepository, IZodiacSignRepository zodiacSignRepository,
     IPathRepository pathRepository, ITreeOfLifeDatabase database)
 {
     _hebrewLetterRepository = hebrewLetterRepository;
     _sephiraRepository = sephiraRepository;
     _planetRepository = planetRepository;
     _zodiacSignRepository = zodiacSignRepository;
     _pathRepository = pathRepository;
     _database = database;
 }
コード例 #4
0
ファイル: Tree.cs プロジェクト: avanderbilt/TreeOfLife
 public Tree(IHebrewLetterRepository hebrewLetterRepository, ISephiraRepository sephiraRepository,
     IPlanetRepository planetRepository, IZodiacSignRepository zodiacSignRepository,
     IPathRepository pathRepository, IElementRepository elementRepository, IMetalRepository metalRepository)
 {
     Paths = pathRepository.ReadAll();
     Sephiroth = sephiraRepository.ReadAll();
     HebrewLetters = hebrewLetterRepository.ReadAll();
     Planets = planetRepository.ReadAll();
     ZodiacSigns = zodiacSignRepository.ReadAll();
     Elements = elementRepository.ReadAll();
     Metals = metalRepository.ReadAll();
 }
コード例 #5
0
        public void Paths_Get_Id_StatusCode_400(int status)
        {
            IPathRepository  pathRepository  = null;
            IPointRepository pointRepository = null;
            PathsController  controller      = new PathsController(pathRepository, pointRepository);

            IActionResult result = controller.GetPath(1);

            int?statusCode = ((ObjectResult)(result.Should().Subject)).StatusCode;

            statusCode.Should().Be(status, $"StatusCode should be {status}");
        }
コード例 #6
0
        public RoutesControllerTests()
        {
            ServiceProvider serviceProvider = CreateServiceProvider();

            IServiceProvider service = serviceProvider.GetService <IServiceProvider>();

            _context         = service.GetRequiredService <DeliveryServiceContext>();
            _pathRepository  = new PathRepository(_context) as IPathRepository;
            _pointRepository = new PointRepository(_context) as IPointRepository;
            _routeRepository = new RouteRepository(_context) as IRouteRepository;

            DatabaseInitializer.Seed(service);
        }
コード例 #7
0
 public ColonelController(
     IColonelRepository colonelRepository,
     IColonelManagementRepository colonelManagementRepository,
     IColonelGradeRepository colonelGradeRepository,
     IGroupPurchaseRepository groupPurchaseRepository,
     IPathRepository pathRepository,
     IBrokerageRepository brokerageRepository
     )
 {
     _colonelRepository           = colonelRepository;
     _colonelManagementRepository = colonelManagementRepository;
     _colonelGradeRepository      = colonelGradeRepository;
     _groupPurchaseRepository     = groupPurchaseRepository;
     _pathRepository      = pathRepository;
     _brokerageRepository = brokerageRepository;
 }
コード例 #8
0
        public void Paths_Add_StatusCode_400(int status)
        {
            IPathRepository  pathRepository  = null;
            IPointRepository pointRepository = null;

            PathsController controller = new PathsController(pathRepository, pointRepository);

            Path path = new Path()
            {
                DestinyId = 1,
                OriginId  = 2
            };

            IActionResult result = controller.PostPath(path);

            int?statusCode = ((ObjectResult)(result.Should().Subject)).StatusCode;

            statusCode.Should().Be(status, $"StatusCode should be {status}");
        }
コード例 #9
0
 public PathsController(IPathRepository pathRepository, IPointRepository pointRepository)
 {
     _pathRepository  = pathRepository;
     _pointRepository = pointRepository;
 }
コード例 #10
0
 public CourseRepository(IPathRepository pathRepository)
 {
     _pathRepository = pathRepository;
 }
コード例 #11
0
ファイル: PathService.cs プロジェクト: Ledium/PathFinder
 public PathService(IPathRepository pathRepository)
 {
     _pathRepository = pathRepository;
 }
コード例 #12
0
 public PathService(IMapper mapper, IPathRepository pathRepository)
 {
     _pathRepository = pathRepository;
     _mapper         = mapper;
 }
コード例 #13
0
 public LogisticCenterHandler(IPathRepository pathRepository,
                              ILogisticCenterRepository logisticCenterRepository)
 {
     _pathRepository           = pathRepository;
     _logisticCenterRepository = logisticCenterRepository;
 }
コード例 #14
0
 static PathController()
 {
     Kernel = new StandardKernel(new LogicModule(), new DataModule());
     PathRepository = Kernel.Get<IPathRepository>();
 }
コード例 #15
0
 public PathsController(ILogger <PathsController> logger, IPathRepository pathRepository)
 {
     _logger         = logger;
     _pathRepository = pathRepository;
 }
コード例 #16
0
 public DeploymentService()
 {
     this.pathRepository           = Factory.GetInstance <IPathRepository>();
     this.backupRepository         = Factory.GetInstance <IBackupRepository>();
     this.packageRepositoryFactory = Factory.GetInstance <IPackageRepositoryFactory>();
 }
コード例 #17
0
ファイル: Program.cs プロジェクト: adoconnection/AspNetDeploy
        static void Main(string[] args)
        {
            ObjectFactoryConfigurator.Configure();

            IPathRepository   pathRepository   = Factory.GetInstance <IPathRepository>();
            IBackupRepository backupRepository = Factory.GetInstance <IBackupRepository>();

            /*  IBackupRepository backupRepository = Factory.GetInstance<IBackupRepository>();
             *
             * backupRepository.RestoreDirectory(Guid.Parse("4487e739-5d2c-44b2-bf2a-a01692b60de0"));
             *
             * Guid storeDirectory = backupRepository.StoreFile(@"H:\AspNetDeploySatelliteWorkingFolder\TestFolder\Project15\Web.config");
             *
             * Console.WriteLine("STORED = " + storeDirectory);
             * Console.ReadKey();
             *
             * backupRepository.RestoreFile(storeDirectory);
             *
             * Console.WriteLine("RESTORED");
             * Console.ReadKey();
             */

            /*ConfigOperation configOperation = new ConfigOperation(backupRepository);
             *
             * configOperation.Configure(JsonConvert.DeserializeObject(@"
             * {
             *  file : 'H:\\AspNetDeploySatelliteWorkingFolder\\TestFolder\\Project15\\Web.config',
             *  content : '
             *      <configuration>
             *          <system.web>
             *              <compilation debug=""false"" />
             *          </system.web>
             *          <appSettings childNodesKeyName=""key"">
             *              <add key=""Site.Version"" value=""1.2"" />
             *              <add key=""BackgroundCMS.TargetAuthorizeUrl"" value=""{var:BackgroundCMS.TargetAuthorizeUrl}"" />
             *          </appSettings>
             *      </configuration>
             *  '
             * }"), new Dictionary<string, object>
             * {
             *  {"BackgroundCMS.TargetAuthorizeUrl", "http://omg.ru"}
             * });*/

            UpdateHostsOperation operation = new UpdateHostsOperation(backupRepository);

            operation.Configure(JsonConvert.DeserializeObject(@"
            {
                add : [
                    {ip: '127.0.0.1', domain: 'testing-1.local'},
                    {ip: '127.0.0.2', domain: 'testing-2.local'}
                ]
            }"));

            operation.Run();
            Console.WriteLine("UPDATED");
            Console.ReadKey();

            operation.Rollback();
            Console.WriteLine("REVERTED");
            Console.ReadKey();

            /*WebSiteOperation webSiteOperation = new WebSiteOperation(backupRepository, new PackageRepository(pathRepository.GetPackagePath(6)));
             *
             *
             * webSiteOperation.Configure(JsonConvert.DeserializeObject(@"
             * {
             *  destination : 'H:\\AspNetDeploySatelliteWorkingFolder\\TestFolder\\Project15',
             *  siteName : 'Project 15',
             *  applicationPoolName : 'Project 15',
             *  projectId : 15,
             *  bindings : [
             *
             *      {
             *          port : 80,
             *          protocol : 'http',
             *          url : 'project15.local'
             *      }
             *  ]
             * }"));
             *
             * webSiteOperation.Run();
             * webSiteOperation.Rollback();*/



            /*if (Directory.Exists(@"H:\AspNetDeploySatelliteWorkingFolder\TestFolder"))
             * {
             *  Directory.Delete(@"H:\AspNetDeploySatelliteWorkingFolder\TestFolder", true);
             *  Directory.CreateDirectory(@"H:\AspNetDeploySatelliteWorkingFolder\TestFolder");
             * }
             */
            /*IPathRepository pathRepository = Factory.GetInstance<IPathRepository>();*/

            /*PackageRepository packageRepository = new PackageRepository(pathRepository.GetPackagePath(6));
             * packageRepository.ExtractProject(15, @"H:\AspNetDeploySatelliteWorkingFolder\TestFolder\Project15");
             * packageRepository.ExtractProject(19, @"H:\AspNetDeploySatelliteWorkingFolder\TestFolder\Project19");
             */

            Console.WriteLine("Complete");
            Console.ReadKey();
        }
コード例 #18
0
 public PathLogic(IUnitOfWork unit, IPathRepository repo)
 {
     this.Unit = unit;
     this.Repo = repo;
 }