public void ShouldReturnTheValueForName() { var properties = new MockProperties(null); object value = new object(); properties.PropertiesList.Add(new MockProperty() { Name = "TestName", Value = value }); var result = DteExtensions.GetValue<object>(properties, "TestName", null); Assert.AreSame(value, result); }
public void ShouldReturnDefaultValueIfNameNotFound() { var properties = new MockProperties(null); object defaultValue = new object(); properties.PropertiesList.Add(new MockProperty() { Name = "TestName", Value = new object() }); var result = DteExtensions.GetValue<object>(properties, "DifferentName", defaultValue); Assert.AreSame(defaultValue, result); }
public MockProjectItem(string pathOrName, bool isLink) { Name = Path.GetFileName(pathOrName); MockProperties = new MockProperties(this); ProjectItems = new MockProjectItems(this); if (isLink) { MockProperties.PropertiesList.Add(new MockProperty("FullPath", pathOrName)); MockProperties.PropertiesList.Add(new MockProperty("IsLink", true)); Kind = Constants.vsProjectItemKindPhysicalFile; } }
public MockProjectItem(string pathOrName, bool isLink = false) { Name = Path.GetFileName(pathOrName); MockProperties = new MockProperties(this); ProjectItems = new MockProjectItems(this); if (isLink) { MockProperties.PropertiesList.Add(new MockProperty("FullPath", pathOrName)); MockProperties.PropertiesList.Add(new MockProperty("IsLink", true)); Kind = Constants.vsProjectItemKindPhysicalFile; } }
public MockProject() { Properties = new MockProperties(this); FullName = string.Format(@"c:\mockProjectPath\{0}\{0}.csproj", random.Next()); ProjectItems = new MockProjectItems(this); }
public MockProject() { Properties = new MockProperties(this); FullName = string.Format(@"c:\mockProjectPath\{0}\{0}.csproj", Random.Next()); ProjectItems = new MockProjectItems(this); }