Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 namespace UnitTests | 5 namespace UnitTests |
| 6 { | 6 { |
| 7 using System; | 7 using System; |
| 8 using System.Collections.Generic; | 8 using System.Collections.Generic; |
| 9 using System.IO; | 9 using System.IO; |
| 10 using System.Linq; | 10 using System.Linq; |
| 11 using System.Management; | 11 using System.Management; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 /// <param name="configuration">Gives the platform and configuration type</p aram> | 320 /// <param name="configuration">Gives the platform and configuration type</p aram> |
| 321 /// <param name="pageName">Property page name where property resides.</param > | 321 /// <param name="pageName">Property page name where property resides.</param > |
| 322 /// <param name="propertyName">Name of the property to check.</param> | 322 /// <param name="propertyName">Name of the property to check.</param> |
| 323 /// <param name="expectedValue">Expected string to contain.</param> | 323 /// <param name="expectedValue">Expected string to contain.</param> |
| 324 /// <param name="ignoreCase">Ignore case when comparing the expected and act ual values.</param> | 324 /// <param name="ignoreCase">Ignore case when comparing the expected and act ual values.</param> |
| 325 public static void AssertPropertyContains( | 325 public static void AssertPropertyContains( |
| 326 VCConfiguration configuration, | 326 VCConfiguration configuration, |
| 327 string pageName, | 327 string pageName, |
| 328 string propertyName, | 328 string propertyName, |
| 329 string expectedValue, | 329 string expectedValue, |
| 330 bool ignoreCase) | 330 bool ignoreCase, |
| 331 bool expand=false) | |
|
binji
2012/10/23 00:59:32
add param to docs above
| |
| 331 { | 332 { |
| 332 StringComparison caseSensitive = ignoreCase ? | 333 StringComparison caseSensitive = ignoreCase ? |
| 333 StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; | 334 StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; |
| 334 | 335 |
| 335 IVCRulePropertyStorage rule = configuration.Rules.Item(pageName); | 336 IVCRulePropertyStorage rule = configuration.Rules.Item(pageName); |
| 336 string propertyValue = rule.GetUnevaluatedPropertyValue(propertyName); | 337 string propertyValue; |
| 338 if (expand) | |
| 339 propertyValue = rule.GetEvaluatedPropertyValue(propertyName); | |
| 340 else | |
| 341 propertyValue = rule.GetUnevaluatedPropertyValue(propertyName); | |
| 342 | |
| 337 | 343 |
| 338 string message = string.Format( | 344 string message = string.Format( |
| 339 "{0} should be contained in {1}. Page: {2}, Property: {3}, Configurati on: {4}", | 345 "{0} should be contained in {1}. Page: {2}, Property: {3}, Configurati on: {4}", |
| 340 expectedValue, | 346 expectedValue, |
| 341 propertyValue, | 347 propertyValue, |
| 342 pageName, | 348 pageName, |
| 343 propertyName, | 349 propertyName, |
| 344 configuration.ConfigurationName); | 350 configuration.ConfigurationName); |
| 345 | 351 |
| 346 Assert.IsTrue(propertyValue.Contains(expectedValue, caseSensitive), messag e); | 352 Assert.IsTrue(propertyValue.Contains(expectedValue, caseSensitive), messag e); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 } | 460 } |
| 455 | 461 |
| 456 foreach (DirectoryInfo subdir in dir.GetDirectories()) | 462 foreach (DirectoryInfo subdir in dir.GetDirectories()) |
| 457 { | 463 { |
| 458 string path = Path.Combine(dest, subdir.Name); | 464 string path = Path.Combine(dest, subdir.Name); |
| 459 CopyDirectory(subdir.FullName, path); | 465 CopyDirectory(subdir.FullName, path); |
| 460 } | 466 } |
| 461 } | 467 } |
| 462 } | 468 } |
| 463 } | 469 } |
| OLD | NEW |