This commit is contained in:
James Newton-King
2014-12-23 00:49:27 +13:00
parent a09f240f51
commit 5d34cedcb3
2 changed files with 25 additions and 3 deletions
+1 -3
View File
@@ -1,4 +1,2 @@
cls
powershell -Command "& { [Console]::WindowWidth = 150; [Console]::WindowHeight = 50; Start-Transcript runbuild.txt; Import-Module ..\Tools\PSake\psake.psm1; Invoke-psake ..\Build\build.ps1 %*; Stop-Transcript; }"
pause
powershell -Command "& { [Console]::WindowWidth = 150; [Console]::WindowHeight = 50; Start-Transcript runbuild.txt; Import-Module ..\Tools\PSake\psake.psm1; Invoke-psake ..\Build\build.ps1 %*; Stop-Transcript; }"
@@ -246,5 +246,29 @@ namespace Newtonsoft.Json.Tests.Linq
Uri i = o.Annotation<Uri>();
Assert.AreEqual(new Uri("http://www.google.com/"), i);
}
[Test]
public void Example()
{
JObject o = JObject.Parse(@"{
'name': 'Bill G',
'age': 58,
'country': 'United States',
'employer': 'Microsoft'
}");
o.AddAnnotation(new HashSet<string>());
o.PropertyChanged += (sender, args) => o.Annotation<HashSet<string>>().Add(args.PropertyName);
o["age"] = 59;
o["employer"] = "Bill & Melinda Gates Foundation";
HashSet<string> changedProperties = o.Annotation<HashSet<string>>();
// age
// employer
Assert.AreEqual(2, changedProperties.Count);
}
}
}