Permalink
Browse files

More fixing of project references

  • Loading branch information...
1 parent 440aec5 commit a007aa492608cee3da7f16adc3bab7d4e2a4c0e1 @ayende ayende committed May 2, 2011
@@ -62,8 +62,8 @@
<Compile Include="ToDoRepository.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\Json\Raven.Json\Raven.Json.g.3.5.csproj">
- <Project>{31740175-3254-489D-AD59-73EF096BA64D}</Project>
+ <ProjectReference Include="..\..\Json\Raven.Json\Raven.Json.csproj">
+ <Project>{B9DD0239-3476-48CB-A541-1B3EC6679BB6}</Project>
<Name>Raven.Json</Name>
</ProjectReference>
<ProjectReference Include="..\Raven.Munin\Raven.Munin.csproj">
@@ -1,144 +0,0 @@
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using Raven.Json.Linq;
-using Xunit;
-
-namespace Raven.Tests.Json
-{
- public class CloningTests
- {
-
-
- public class Blog
- {
- public string Title
- {
- get;
- set;
- }
-
- public string Category
- {
- get;
- set;
- }
-
- public BlogTag[] Tags
- {
- get;
- set;
- }
- }
-
- public class BlogTag
- {
- public string Name { get; set; }
- }
-
- [Fact]
- public void WhenCloningWillRetainAllValues()
- {
- var newBlog = new Blog()
- {
- Tags = new[]{
- new BlogTag() { Name = "SuperCallaFragalisticExpealadocious" }
- }
- };
-
- var expected = RavenJObject.FromObject(newBlog);
- var actual = new RavenJObject(expected);
-
- Assert.Equal(expected.ToString(Formatting.None), actual.ToString(Formatting.None));
- }
-
- [Fact]
- public void CloningTestsStoresValues()
- {
- var f = new RavenJObject();
- f.Add("test", "Test");
- f.Add("2nd", "second");
- Assert.True(f.Count == 2);
- }
-
- [Fact]
- public void CloningTestsWorksCorrectly()
- {
- var f = new RavenJObject();
- f["1"] = new RavenJValue(1);
- f["2"] = new RavenJValue(2);
-
- var f1 = (RavenJObject)f.CloneToken();
- f1["2"] = new RavenJValue(3);
-
- var val = (RavenJValue) f["2"];
- Assert.Equal(2, val.Value);
- val = (RavenJValue)f1["2"];
- Assert.Equal(3, val.Value);
-
- var f2 = (RavenJObject)f1.CloneToken();
- val = (RavenJValue)f2["2"];
- Assert.Equal(3, val.Value);
-
- f["2"] = f2;
- f1 = (RavenJObject) f.CloneToken();
- f.Remove("2");
- Assert.Null(f["2"]);
- Assert.NotNull(f1["2"]);
- }
-
- [Fact]
- public void ChangingValuesOfParent()
- {
- var obj = RavenJObject.Parse(" { 'Me': { 'ObjectID': 1} }");
- var obj2 = obj.CloneToken();
- var obj3 = obj.CloneToken();
-
- var o = obj2.Value<RavenJObject>("Me");
- o["ObjectID"] = 2;
-
- obj3.Value<RavenJObject>("Me")["ObjectID"] = 3;
- Assert.Equal(1, obj.Value<RavenJObject>("Me").Value<int>("ObjectID"));
- Assert.Equal(2, obj2.Value<RavenJObject>("Me").Value<int>("ObjectID"));
- Assert.Equal(3, obj3.Value<RavenJObject>("Me").Value<int>("ObjectID"));
- }
-
- public void ShouldNotFail()
- {
- var root = new RavenJObject();
- var current = root;
- for (int i = 0; i < 10000; i++)
- {
- var temp = new RavenJObject();
- current.Add("Inner", temp);
- current = temp;
- }
-
- var anotherRoot = (RavenJObject)root.CloneToken();
- do
- {
- anotherRoot["Inner"] = 0;
- } while ((anotherRoot = anotherRoot["Inner"] as RavenJObject) != null);
- }
-
- [Fact]
- public void ShouldBehaveNicelyInMultithreaded()
- {
- var obj = new RavenJObject
- {
- {"prop1", 2},
- {"prop2", "123"}
- };
-
- var copy = (RavenJObject)obj.CloneToken() ;
- copy["@id"] = "movies/1";
-
- Parallel.For(0, 10000, i =>
- {
- Assert.True(copy.ContainsKey("@id"));
- var foo = (RavenJObject)copy.CloneToken();
- Assert.True(foo.ContainsKey("@id"));
- Assert.True(copy.ContainsKey("@id"));
- });
- }
- }
-}
@@ -106,6 +106,12 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Compile Include="..\Modules\Json\Raven.Json.Tests\CloningTests.cs">
+ <Link>Json\CloningTests.cs</Link>
+ </Compile>
+ <Compile Include="..\Modules\Json\Raven.Json.Tests\RavenJObjects.cs">
+ <Link>Json\RavenJObjects.cs</Link>
+ </Compile>
<Compile Include="..\Modules\Munin\Raven.Munin.Tests\Bugs\Compaction.cs">
<Link>Munin\Bugs\Compaction.cs</Link>
</Compile>
@@ -416,8 +422,6 @@
<Compile Include="Indexes\ShoppingCartEventsToShopingCart.cs" />
<Compile Include="Indexes\UsingCustomLuceneAnalyzer.cs" />
<Compile Include="IndexQueryUrl.cs" />
- <Compile Include="Json\CloningTests.cs" />
- <Compile Include="Json\RavenJObjects.cs" />
<Compile Include="Linq\CommitInfo.cs" />
<Compile Include="Linq\SampleDynamicCompilationExtension.cs" />
<Compile Include="Linq\SampleGeoLocation.cs" />
@@ -542,6 +546,10 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\Modules\Json\Raven.Json\Raven.Json.csproj">
+ <Project>{B9DD0239-3476-48CB-A541-1B3EC6679BB6}</Project>
+ <Name>Raven.Json</Name>
+ </ProjectReference>
<ProjectReference Include="..\Modules\Munin\Raven.Munin\Raven.Munin.csproj">
<Project>{486537C2-EDF7-404F-9CFB-EEE25996DF5F}</Project>
<Name>Raven.Munin</Name>
Oops, something went wrong.

0 comments on commit a007aa4

Please sign in to comment.