public void MatchesLeaf_ShouldReturnTrueWhenEntireLeafMatchesText() { var referenceResource = new ReferenceResource(new TranslatedResource("AB.CD.EF", AnySearchText, AnyTranslatedText)); referenceResource.MatchesLeaf("ef").Should().BeTrue(); referenceResource.MatchesLeaf("CD.ef").Should().BeTrue(); }
private void StartDataGridDrag(DataGrid sender, MouseEventArgs e) { isDragging = true; try { int rowIndex = GetCurrentRowIndex(e.GetPosition); if (rowIndex < 0) { return; } this.dataGridAbilityReferences.SelectedIndex = rowIndex; ReferenceResource animationResource = dataGridAbilityReferences.Items[rowIndex] as ReferenceResource; if (animationResource != null) { DataObject dragData = new DataObject(ANIMATION_DRAG_KEY, animationResource); //DragDrop.DoDragDrop(dataGridAbilityReferences, dragData, DragDropEffects.Move); if (DragDrop.DoDragDrop(dataGridAbilityReferences, dragData, DragDropEffects.Move) != DragDropEffects.None) { dataGridAbilityReferences.SelectedItem = animationResource; } } } catch (Exception ex) { } finally { isDragging = false; } }
public void MatchesLeaf_ShouldReturnFalseWhenPartLeafMatchesText() { var referenceResource = new ReferenceResource(new TranslatedResource("AB.CD.EF", AnySearchText, AnyTranslatedText)); referenceResource.MatchesLeaf("F").Should().BeFalse(); referenceResource.MatchesLeaf("D.EF").Should().BeFalse(); }
public void EachPartShouldBeCountedOnce() { var referenceResource = new ReferenceResource(TestResource); referenceResource.CountMatchingResourceParts("A").Should().Be(1); referenceResource.CountMatchingResourceParts("B").Should().Be(1); referenceResource.CountMatchingResourceParts("C").Should().Be(1); referenceResource.CountMatchingResourceParts("D").Should().Be(1); }
public void CountResourceParts_ShouldReturnNumberOfResourceParts() { var referenceResource = new ReferenceResource(TestResource); referenceResource.CountResourceParts().Should().Be(4); }
public void MatchesExactText_ShouldReturnFalseWhenTextIsNotEqualToResourceText() { var referenceResource = new ReferenceResource(TestResource); referenceResource.MatchesExactText("another text").Should().BeFalse(); }
public void MatchesExactText_ShouldReturnTrueWhenTextIsEqualToResourceText() { var referenceResource = new ReferenceResource(TestResource); referenceResource.MatchesExactText(TestResource.Text).Should().BeTrue(); }
public void SeparatePartsInDifferentOrder_ShouldHaveResultWithMatchingNumberOfParts() { var referenceResource = new ReferenceResource(TestResource); referenceResource.CountMatchingResourceParts("B.X.A.Y").Should().Be(2); }
public void PartString_ShouldHaveResultWithSameNumberOfParts() { var referenceResource = new ReferenceResource(TestResource); referenceResource.CountMatchingResourceParts("A.B").Should().Be(2); }