public static void AddTestDocuments() { if (!_isSetup) { return; // DB wasn't touched, so nothing to do here } var dbUri = VstsSettings.GetSetting("dbUri", DefaultDbUri); if (dbUri != DefaultDbUri) { return; // this data is only to help local devs - don't put on live site } using (var repository = New(deleteAllDocuments: false).Register()) { DomainRegistry.ValidationContext = new ValidationContext(true); DomainRegistry.NowUtc = () => DateTime.UtcNow; DomainRegistry.CloudStore = LocalCloudStore.New(clearContainer: false); AddTestBsg(repository, "unitTest"); var coc = AddTestCoc(repository, "unitTest"); AddTestBsg(repository, "unitTestExisting", bsg => { bsg.ApplicantDetails.EmailAddress = coc.UserId; Builder.Modify(bsg) .With(f => f.UserId, coc.UserId) .With(f => f.Declaration, BestStartGrantForms.Dto.DeclarationBuilder.NewValid()) .With(f => f.Completed, DateTime.UtcNow); }); } }
private static void SetUp() { if (_isSetup) { return; } var dbUri = new Uri(VstsSettings.GetSetting("dbUri", DefaultDbUri)); var dbKey = VstsSettings.GetSetting("dbKey", DefaultDbKey); Repository.Init(dbUri, dbKey); _isSetup = true; }
private static void SetUp() { if (_isSetup) { return; } var storageConnectionString = VstsSettings.GetSetting("storageConnectionString", DefaultStorageConnectionString); var storageName = VstsSettings.GetSetting("storageName", DefaultStorageName); CloudStore.Init(storageConnectionString, storageName); _isSetup = true; }
public static void VerifyRunning() { var dbUri = VstsSettings.GetSetting("dbUri", DefaultDbUri); if (dbUri != DefaultDbUri) { return; // this is just a check to help local devs } try { using (var tcpClient = new TcpClient()) tcpClient.Connect("localhost", 8081); } catch { Assert.Fail("Could not verify DocumentDB connection - please verify DocumentDB is running"); } }
public static void VerifyRunning() { var storageConnectionString = VstsSettings.GetSetting("storageConnectionString", DefaultStorageConnectionString); if (storageConnectionString != DefaultStorageConnectionString) { return; // this is just a check to help local devs } try { using (var tcpClient = new TcpClient()) tcpClient.Connect("localhost", 10000); } catch { Assert.Fail("Could not verify Azure Blob Storage emulator connection - please verify Storage Emulator is running"); } }