コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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"));
        }