public void Digits5() { var queryParserResult = QueryParser().ParseIntoWords(@"""заголовки - h [11:52:54 AM] Maryia Shchamialiova"" еще ?чуть +не мандатори ""теперь снова мандатори"""); queryParserResult.Should(Be.EquivalentTo("+заголовки +am +maryia +shchamialiova *еще* ?чуть +не *мандатори* +теперь +снова +мандатори +115254".Split(' '))); }
public void ProfileStorageShouldContainListOfStrings(string profileName, string accountName, string[] stringValues) { SetCurrentPluginContext(accountName, profileName); var list = StorageRepository.Get <StringValue>(); list.Select(x => x.Value).ToArray().Should(Be.EquivalentTo(stringValues)); }
public void PluginProfilesShouldBeCreated(string[] pluginProfileNames) { var profiles = (from profile in Account.Profiles select profile.Name.Value).ToArray(); profiles.Should(Be.EquivalentTo(pluginProfileNames)); }
public void ShouldProcessUiMessageWhenItArrives() { var pluginQueueFactory = new PluginQueueFactoryMock(); var transport = CreateTransport(pluginQueueFactory); var messages = new List <Message> { new Message { Body = "Message1" }, new Message("Message2") }; var uiMessages = new List <Message>(); pluginQueueFactory.SetMessagesForQueue(transport.InputQueue, messages); pluginQueueFactory.SetMessagesForQueue(transport.UICommandInputQueue, uiMessages); transport.Start(); transport.Process(); uiMessages.Add(new Message { Body = "UiMessage1" }); transport.Process(); transport.Process(); pluginQueueFactory.ProcessedMessages.Select(x => x.Body as string).ToArray().Should( Be.EquivalentTo(new[] { "Message1", "UiMessage1", "Message2" })); }
public void ShouldProcessUiMessagesFirst() { var pluginQueueFactory = new PluginQueueFactoryMock(); var transport = CreateTransport(pluginQueueFactory); var messages = new List <Message> { new Message { Body = "Message1" }, new Message("Message2") }; var uiMessages = new List <Message> { new Message { Body = "UiMessage1" }, new Message("UiMessage2") }; pluginQueueFactory.SetMessagesForQueue(transport.InputQueue, messages); pluginQueueFactory.SetMessagesForQueue(transport.UICommandInputQueue, uiMessages); transport.Start(); var totalMessageCount = messages.Count + uiMessages.Count; for (var i = 0; i < totalMessageCount; i++) { transport.Process(); } pluginQueueFactory.ProcessedMessages.Select(x => x.Body as string).ToArray().Should( Be.EquivalentTo(new[] { "UiMessage1", "UiMessage2", "Message1", "Message2" })); }
public void GenerateDescription__AllPropertiesGroupedCorrectly() { var joinedEntities = new[] { PropInfo.FromPropertyExpression <Order>(v => v.Customer) }; var components = new[] { PropInfo.FromPropertyExpression <Order>(v => v.PaymentInfo), PropInfo.FromPropertyExpression <Order>(v => v.AuditInfo) }; var simpleProps = new[] { PropInfo.FromPropertyExpression <Order>(v => v.Id), PropInfo.FromPropertyExpression <Order>(v => v.ItemsCount), PropInfo.FromPropertyExpression <Order>(v => v.Note), PropInfo.FromPropertyExpression <Order>(v => v.Type), PropInfo.FromPropertyExpression <Order>(v => v.OrderDate), PropInfo.FromPropertyExpression <Order>(v => v.TotalPrice), PropInfo.FromPropertyExpression <Order>(v => v.Version), }; var modelDescription = PersistenceModelPropertiesDescriptionGenerator.GenerateDescription(typeof(Order)); modelDescription.Should(Be.Not.Null); modelDescription.ComponentProperties.Count.Should(Be.EqualTo(components.Length)); modelDescription.JoinedModels.Count.Should(Be.EqualTo(joinedEntities.Length)); modelDescription.SimpleProperties.Count.Should(Be.EqualTo(simpleProps.Length)); modelDescription.ComponentProperties.Should(Be.EquivalentTo(components)); modelDescription.JoinedModels.Should(Be.EquivalentTo(joinedEntities)); modelDescription.SimpleProperties.Should(Be.EquivalentTo(simpleProps)); }
public void CheckVersionParsing() { var t = new DocumentIndexType(DocumentIndexTypeToken.Entity, DocumentIndexDataTypeToken.Digits, "Entity", Enumerable.Empty <Enum>(), Enumerable.Empty <Enum>(), 2, new DigitsDocumentIndexDataTypeService(), new FileServiceStub()); IEnumerable <int> versions = t.GetVersions(AccountName.Empty, new DocumentIndexSetup(string.Empty, 0, 0, 0)); versions.Should(Be.EquivalentTo(new[] { 1 })); }
public void ShouldCheckCustomField(int bugzillaBugId, string fieldName, string[] fieldValue) { GetBugzillaBug(bugzillaBugId).CustomFields .Single(f => f.Name == fieldName) .Values .Should(Be.EquivalentTo(fieldValue)); }
public void RevisionShouldBeCreatedInTp(string sourceControlId) { var revisionIds = ObjectFactory.GetInstance <TransportMock>().TpQueue.GetCreatedDtos <RevisionDTO>().Select(x => x.SourceControlID). ToArray(); revisionIds.Should(Be.EquivalentTo(new[] { sourceControlId })); }
public void CheckCreatedInTpMashupWithConfig(string mashupName, string placeholders, string[] fileNames) { var mashup = GetMashupMessageByName(mashupName); mashup.MashupName.Should(Be.EqualTo(mashupName)); mashup.PluginMashupScripts.Select(x => x.FileName).ToArray().Should(Be.EquivalentTo(fileNames)); mashup.Placeholders.Select(p => p.ToLower()).Should(Be.EquivalentTo(placeholders.Split(',').Select(p => p.Trim().ToLower()))); }
public void CheckCreatedInTpMashup(string mashupName, string placeholders, string script) { var mashup = GetMashupMessageByName(mashupName); mashup.MashupName.Should(Be.EqualTo(mashupName)); mashup.PluginMashupScripts.Single().ScriptContent.Should(Be.EqualTo(script)); mashup.Placeholders.Select(p => p.ToLower()).Should(Be.EquivalentTo(placeholders.Split(',').Select(p => p.Trim().ToLower()))); }
public void ProjectDataSubstractTest() { var left = new ProjectIndexData(new int?[] { 1, 2 }); var right = new ProjectIndexData(new int?[] { 1, 2, 3 }); var result = ProjectIndexData.Substract(right, left); result.ProjectIds.Should(Be.EquivalentTo(new[] { 3 })); }
public void ShouldStoreAndRetrieveNamedRecordForProfile() { var profileStorages = CreateProfileStorages(); var retrieved = _persister.FindBy(_profile.Id).ToArray(); retrieved.Should(Be.EquivalentTo(profileStorages).Using <ProfileStorage>(Compare)); }
public void MessageShouldBeMarkedAsProcessed(int messageId) { var command = Transport.TpQueue.GetMessages <UpdateCommand>().First(x => x.Dto is MessageDTO); command.ChangedFields.Should(Be.EquivalentTo(new[] { MessageField.IsProcessed.ToString() })); ((MessageDTO)command.Dto).IsProcessed.Should(Be.True); ObjectFactory.GetInstance <TpInMemorySagaPersister>().Get <ISagaEntity>().Where(x => !(x is NewEmailProfileInitializationSagaData)).Count().Should( Be.EqualTo(0), "Saga is not completed"); }
public void CheckAttachments(string bugName, string[] attachments) { var bugId = GetLastBugIdByName(bugName); Storage.Get <AttachmentDTO>().Where(c => c.GeneralID == bugId) .Select(c => c.Description) .ToArray() .Should(Be.EquivalentTo(attachments)); }
public void CheckComments(string bugName, string[] comments) { var bugId = GetLastBugIdByName(bugName); Storage.Get <CommentDTO>(bugId.ToString(CultureInfo.InvariantCulture)) .Select(c => c.Description) .ToArray() .Should(Be.EquivalentTo(comments)); }
private static void TestSubversionRepository(string firstFolder, params long[] revisionIds) { using (var sourceControlService = new Subversion(GetLocalRepositorySettings(firstFolder), ObjectFactory.GetInstance <ICheckConnectionErrorResolver>(), ObjectFactory.GetInstance <IActivityLogger>(), ObjectFactory.GetInstance <IDiffProcessor>())) { var range = sourceControlService.GetFromTillHead(0.ToString(), 100).Single(); var revisionsFromRepo = sourceControlService.GetRevisions(range).Select(x => long.Parse(x.Id.Value)).ToArray(); revisionsFromRepo.Should(Be.EquivalentTo(revisionIds)); } }
public void CheckReturnedSources(string sourceName, string packages) { IEnumerable <LibraryRepositoryDto> commandResult = GetReturnedSources(); commandResult .Single(r => r.Name == sourceName.Trim()).Packages .Select(p => p.Name) .Should(Be.EquivalentTo(packages.Split(',').Select(p => p.Trim()))); }
public void ShouldRetrieveAuthors() { using (var mercurial = CreateMercurial()) { var authors = mercurial.RetrieveAuthors(new DateRange(MercurialRevisionId.UtcTimeMin, DateTime.Now)); authors.Should(Be.EquivalentTo(new[] { "msuhinin" })); } }
public void BugShouldBeUpdated(string[] bugNames) { var bugs = ObjectFactory.GetInstance <TransportMock>().TpQueue.GetMessages <UpdateCommand>().Where(x => x.Dto is BugDTO).Select( x => ((BugDTO)x.Dto).Name). ToList(); bugs.Should(Be.EquivalentTo(bugNames)); }
public void ShouldRetrieveAuthors() { using (var git = CreateGit()) { var authors = git.RetrieveAuthors(new DateRange(GitRevisionId.UtcTimeMin, DateTime.UtcNow)); authors.Should(Be.EquivalentTo(new[] { "Valentine Palazkov" })); } }
public void CheckMashupFilesInStorage(string mashupName, string placeholders, string[] fileNames) { var mashup = ScriptStorage.GetMashup(mashupName); mashup.Name.Should(Be.EqualTo(mashupName)); mashup.Placeholders.ToLower().Should(Be.EqualTo(placeholders.ToLower())); mashup.Files.Select(x => x.FileName).ToArray().Should(Be.EquivalentTo(fileNames)); MashupManagerProfile.MashupNames.Should(Contains.Item(mashupName)); }
private static void AssertMessagesWereSent( IEnumerable messagesSentLocally, IEnumerable <string> expectedMessageNames, string profileName, string accountName) { messagesSentLocally.Should(Be.EquivalentTo(expectedMessageNames)); Bus.GetOutProfileName().Should(Be.EqualTo((ProfileName)profileName)); Bus.GetOutAccountName().Should(Be.EqualTo(new AccountName(accountName))); }
public void ShouldRetrieveAuthors() { using (var subversion = new Subversion(GetLocalRepositorySettings(), ObjectFactory.GetInstance <ICheckConnectionErrorResolver>(), ObjectFactory.GetInstance <IActivityLogger>(), ObjectFactory.GetInstance <IDiffProcessor>())) { var revisions = subversion.GetRevisions(subversion.GetFromTillHead(new SvnRevisionId(0), 100).Single()).OrderBy(x => x.Time); var authors = subversion.RetrieveAuthors(new DateRange(revisions.First().Time, revisions.Last().Time)); authors.Should(Be.EquivalentTo(revisions.Select(x => x.Author).Distinct().ToArray())); } }
private static void AssertRequesterMadeAlive(UserLite requester) { var updateCommand = Context.Transport.TpQueue.GetMessages <UpdateCommand>().Where(x => x.Dto is RequesterDTO).First(); updateCommand.ChangedFields.Should(Be.EquivalentTo(new[] { RequesterField.DeleteDate.ToString() })); var requesterDto = (RequesterDTO)updateCommand.Dto; requesterDto.DeleteDate.Should(Be.Null); requesterDto.ID.Should(Be.EqualTo(requester.Id)); }
private static void AssertEqual(IList <RevisionEntryInfo> actual, IList <RevisionEntryInfo> expected) { actual.Select(x => x.Action).ToArray().Should(Be.EquivalentTo(expected.Select(x => x.Action).ToArray())); actual.Select(x => x.Path).ToArray().Should(Be.EquivalentTo(expected.Select(x => x.Path).ToArray())); for (int i = 0; i < actual.Count; i++) { actual[i].Action.Should(Be.EqualTo(expected[i].Action)); actual[i].Path.Should(Be.EqualTo(expected[i].Path)); } }
public void CheckProfileMashups(string[] mashupNames) { MashupManagerProfile.MashupNames.Should(Be.EquivalentTo(mashupNames)); foreach (var mashupName in mashupNames) { var mashup = GetMashupFromStorage(mashupName); mashup.Placeholders.Should(Be.Not.Null.And.Not.Empty); mashup.Files.Should(Be.Not.Null.And.Not.Empty); } }
private void AssertCommits(params string[] commits) { using (var git = CreateGit()) { GitRevisionId startRevisionId = CreateGitRevisionId(DateTime.Parse("2011-11-02 1:57:19 PM")); var revisionRange = git.GetFromTillHead(startRevisionId, 100).Single(); var revisions = git.GetRevisions(revisionRange); revisions.Select(x => x.Comment).ToArray().Should(Be.EquivalentTo(commits)); revisions.Select(x => x.Author).Distinct().ToArray().Should(Be.EquivalentTo(new[] { "Valentine Palazkov" })); } }
private void AssertCommits(params string[] commits) { using (var mercurial = CreateMercurial()) { MercurialRevisionId startRevisionId = CreateMercurialRevisionId(DateTime.Parse("2011-11-02 1:57:19 PM")); var revisionRange = mercurial.GetFromTillHead(startRevisionId, 100).Single(); var revisions = mercurial.GetRevisions(revisionRange); revisions.Select(x => x.Comment).ToArray().Should(Be.EquivalentTo(commits)); revisions.Select(x => x.Author).Distinct().ToArray().Should(Be.EquivalentTo(new[] { "msuhinin" })); } }
private void AssertCommits(string[] commits, string startRevision = "1", string endRevision = "19") { using (var tfs = CreateTfs()) { TfsRevisionId startRevisionId = CreateTfsRevisionId(startRevision); TfsRevisionId endRevisionId = CreateTfsRevisionId(endRevision); var revisionRange = tfs.GetFromAndBefore(startRevisionId, endRevision, ConfigHelper.Instance.PageSize).Single(); var revisions = tfs.GetRevisions(revisionRange); revisions.Select(x => x.Comment).ToArray().Should(Be.EquivalentTo(commits)); revisions.Select(x => x.Author).Distinct().ToArray().Should(Be.EquivalentTo(new[] { "ARTGROUP\\msuhinin" })); } }