private void load(JsonStore jsonStore) { Add(world = jsonStore.Deserialize <World>("Json/world.json")); //world.Spin(1000, RotationDirection.Clockwise).Loop(); //world.Anchor = Anchor.Centre; //world.Origin = Anchor.Centre; world.OnLoadComplete += _ => Schedule(worldLoadComplete); }
public void MigratingV1ToVXWithNoUpgradePath_ShouldThrowAnException() { //Arrange: var v1 = new V1Dto(5, "String Value"); var v1Json = JsonStore.Serialize(v1); Action action = () => JsonStore.Deserialize <VXDto>(v1Json); //Act: action.Should().Throw <InvalidOperationException>(); }
private void load(Story story, JsonStore jsonStore) { InternalChildren = new Drawable[] { jsonStore.Deserialize <World>(story.SpawnWorldFile), new ArborUI { Depth = float.MinValue + 1, } }; }
public void MigratingV1ToV3_ShouldPopulateAllProperties() { //Arrange: var v1 = new V1Dto(5, "String Value"); var v1Json = JsonStore.Serialize(v1); //Act: var v3 = JsonStore.Deserialize <V3Dto>(v1Json); //Assert: v3.IntProp.Should().Be(v1.IntProperty); v3.NewStringProp.Should().BeEquivalentTo(V1Dto.NewStringProp); }
public void MigratingV1ToV1_ShouldPopulateAllProperty() { //Arrange: var v1 = new V1Dto(5, "String Value"); var v1Json = JsonStore.Serialize(v1); //Act: var v1Copy = JsonStore.Deserialize <V1Dto>(v1Json); //Assert: v1Copy.IntProperty.Should().Be(v1.IntProperty); v1Copy.StringProperty.Should().BeEquivalentTo(v1.StringProperty); }
public void MigratingV1ToV2_ShouldPopulateRenamedProperty() { //Arrange: var v1 = new V1Dto(5, "String Value"); var v1Json = JsonStore.Serialize(v1); //Act: var v2 = JsonStore.Deserialize <V2Dto>(v1Json); //Assert: v2.IntProperty.Should().Be(v1.IntProperty); v2.StringPropertyRenamed.Should().BeEquivalentTo(v1.StringProperty); v2.NewStringProp.Should().BeEquivalentTo(V1Dto.NewStringProp); }