public HoconQuickInfoSource(HoconQuickInfoSourceProvider provider, ITextBuffer buffer) { _provider = provider; _buffer = buffer; var hoconContent = buffer.CurrentSnapshot.GetText(); _hoconRetriever = new HoconRetriever(hoconContent, new PathConstructor()); }
public void When_Getting_Value(string hocon, string path, string expectedResult) { //Arrange IEnumerator <string> enumerator = (new[] { hocon }).AsEnumerable().GetEnumerator(); var pathConstructorMock = new Mock <IPathConstructor>(); pathConstructorMock.Setup( ctor => ctor.ConstructPathBackwards(enumerator, IRRELEVAENT_INT)).Returns(path); var retriever = new HoconRetriever(hocon, pathConstructorMock.Object); //Act var hoconConfig = retriever.GetHoconObject(enumerator, IRRELEVAENT_INT); //Assert Assert.That(hoconConfig, Is.EqualTo(expectedResult)); }