Ejemplo n.º 1
0
        public void Setup()
        {
            _env = new TestEnvironment();
            _env.Settings.CommitWhenDone = true;
            _lfProject = LanguageForgeProject.Create(_env.Settings, testProjectCode);
            TestEnvironment.CopyFwProjectTo(testProjectCode, _env.Settings.WebWorkDirectory);

            // Guids are named for the diffs for the modified test project
            _testEntryGuid = Guid.Parse(testEntryGuidStr);
            _testCreatedEntryGuid = Guid.Parse(testCreatedEntryGuidStr);
            _testDeletedEntryGuid = Guid.Parse(testDeletedEntryGuidStr);

            _languageDepotFolder = new TemporaryFolder("SyncTestLD");
            _lDSettings = new LfMergeSettingsDouble(_languageDepotFolder.Path);
            Directory.CreateDirectory(_lDSettings.WebWorkDirectory);
            LDProjectFolderPath = Path.Combine(_lDSettings.WebWorkDirectory, testProjectCode);

            _mongoConnection = MainClass.Container.Resolve<IMongoConnection>() as MongoConnectionDouble;
            if (_mongoConnection == null)
                throw new AssertionException("Sync tests need a mock MongoConnection that stores data in order to work.");
            _recordFactory = MainClass.Container.Resolve<MongoProjectRecordFactory>() as MongoProjectRecordFactoryDouble;
            if (_recordFactory == null)
                throw new AssertionException("Sync tests need a mock MongoProjectRecordFactory in order to work.");

            _transferFdoToMongo = new TransferFdoToMongoAction(_env.Settings, _env.Logger, _mongoConnection);
        }
        public void FixtureSetup()
        {
            _env = new TestEnvironment();

            var ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties();
            var uri = new Uri("mongodb://" + _env.Settings.MongoDbHostNameAndPort);
            if (ipGlobalProperties.GetActiveTcpListeners().Count(t => t.Port == uri.Port) == 0)
            {
                Assert.Ignore("Ignoring tests because MongoDB doesn't seem to be running on {0}.",
                    _env.Settings.MongoDbHostNameAndPort);
            }
        }
 public override void BeforeTest(TestDetails testDetails)
 {
     _env = new TestEnvironment();
 }
Ejemplo n.º 4
0
 public void Setup()
 {
     _env = new TestEnvironment(registerProcessingStateDouble: false);
 }