Exemple #1
0
        public void SetsPort()
        {
            var processor = new SetOptions(null, null, "12345", null);
            var args      = new StartMongoDbArgs();

            processor.Process(args);
            args.Port.Value.Should().Be(12345);
        }
Exemple #2
0
        public void SetsAdditionalArgs()
        {
            var processor = new SetOptions(null, null, null, "additional args");
            var args      = new StartMongoDbArgs();

            processor.Process(args);
            args.AdditionalArgs.Should().Be("additional args");
        }
Exemple #3
0
        public void SetsExePath()
        {
            var processor = new SetOptions("exe path", null, null, null);
            var args      = new StartMongoDbArgs();

            processor.Process(args);
            args.ExePath.Should().Be("exe path");
        }
Exemple #4
0
        public void SetsDbPath()
        {
            var processor = new SetOptions(null, "db path", null, null);
            var args      = new StartMongoDbArgs();

            processor.Process(args);
            args.DbFolderPath.Should().Be("db path");
        }
Exemple #5
0
        public void LeavesPreviousPortValueWhenNotSupplied()
        {
            var processor = new SetOptions(null, null, "", null);
            var args      = new StartMongoDbArgs()
            {
                Port = 12345
            };

            processor.Process(args);
            args.Port.Value.Should().Be(12345);
        }
 public void Process(StartMongoDbArgs args)
 {
     if (!string.IsNullOrWhiteSpace(_exePath))
     {
         args.ExePath = _exePath;
     }
     if (!string.IsNullOrWhiteSpace(_dbFolderPath))
     {
         args.DbFolderPath = _dbFolderPath;
     }
     if (!string.IsNullOrWhiteSpace(_additionalArgs))
     {
         args.AdditionalArgs = _additionalArgs;
     }
     if (_port.HasValue && _port.Value > 0)
     {
         args.Port = _port.Value;
     }
 }