protected void GivenReferencedTypes(IEnumerable<Type> types) { TheTypeNavigator = new TypeNavigator(types); TheViewExplorer = MockRepository.GenerateMock<IViewExplorer>(); TheViewExplorer.Expect(x => x.GetTypeNavigator()).Return(TheTypeNavigator); TheViewExplorer.Expect(x => x.GetLocalVariableChunks()).Return(null); TheViewExplorer.Expect(x => x.GetViewDataVariableChunks()).Return(null); }
protected void GivenReferencedTypes(IEnumerable <Type> types) { TheTypeNavigator = new TypeNavigator(types); TheViewExplorer = MockRepository.GenerateMock <IViewExplorer>(); TheViewExplorer.Expect(x => x.GetTypeNavigator()).Return(TheTypeNavigator); TheViewExplorer.Expect(x => x.GetLocalVariableChunks()).Return(null); TheViewExplorer.Expect(x => x.GetViewDataVariableChunks()).Return(null); }
public void ShouldReturnContentNamesAsAttributeValues() { var point = GetSnapShotPoint("<div><content name=\"\" </div>", 20); _mockViewExplorer.Expect(x => x.GetContentNames()).Return(new List <string> { "title", "head", "view", "footer" }); var completionSet = CompletionSetFactory.GetCompletionSetFor(point, _stubTrackingSpan, _mockViewExplorer); var completions = completionSet.Completions.ToList(); Assert.That(completionSet, Is.InstanceOf(typeof(AttributeCompletionSet))); Assert.That(completions.Count, Is.EqualTo(4)); Assert.That(completions.Exists(a => a.DisplayText == "title")); Assert.That(completions.Exists(a => a.DisplayText == "footer")); }