public void ToStructureTest_ScriptVrDebug() { var input = new ConfigJson() { ScriptVrDebug = true, }; var result = input.ToStructure(); Assert.IsFalse(result.Item.HideCameraFromViewrs); Assert.IsFalse(result.Item.EnableDisplaycaptureChromarkey); Assert.IsFalse(result.Item.EnableNicovideoChromakey); Assert.IsNull(result.Item.CaptureFormat); Assert.IsFalse(result.Studio.AllowDirectView); Assert.IsFalse(result.Humanoid.UseFastSpringBone); Assert.IsNull(result.Mode); Assert.IsFalse(result.DirectViewTalk); Assert.IsFalse(result.EnableLookingGlass); Assert.IsFalse(result.EnableVivesranipalEye); Assert.IsFalse(result.EnableVivesranipalBlink); Assert.IsFalse(result.EnableVivesranipalEyeWithEmothion); Assert.IsFalse(result.EnableVivesranipalLip); Assert.IsTrue(result.EmbeddedScript.VrDebug); }
public void ToStructureTest_全項目() { var input = new ConfigJson() { CharacterModels = new ObservableCollection <int>(new[] { 111, 222 }), BackgroundModels = new ObservableCollection <int>(new[] { 123, 456 }), MylistIds = new ObservableCollection <int>(new[] { 11, 22 }), BroadcasterComments = new ObservableCollection <string>(new[] { "Foo", "Bar" }), NgScoreThreshold = -100, BackgroundUrls = new ObservableCollection <Uri>(new[] { new Uri("http://background.foo"), new Uri("http://background.bar") }), ImageUrls = new ObservableCollection <Uri>(new[] { new Uri("http://image.foo"), new Uri("http://image.bar") }), DoubleSidedImageUrls = new ObservableCollection <ConfigJson.DoubleImageUrls>(new[] { new ConfigJson.DoubleImageUrls(new Uri("http://dsfrong.bar"), new Uri("http://dsback.bar")) }), HiddenImageUrls = new ObservableCollection <Uri>(new[] { new Uri("http://back.foo") }), HiddenDoubleSidedImageUrls = new ObservableCollection <ConfigJson.DoubleImageUrls>(new[] { new ConfigJson.DoubleImageUrls(new Uri("http://hdsfront.bar"), new Uri("http://hdsback.bar")) }), NicovideoIds = new ObservableCollection <string>(new[] { "tdfoo" }), WhiteboardUrls = new ObservableCollection <Uri>(new[] { new Uri("http://white.foo") }), CueCardUrls = new ObservableCollection <Uri>(new[] { new Uri("http://cue.foo") }), PngCaptureFormat = false, CaptureResolution = CaptureResolution.WQHD, HideCameraFromViewers = false, DisplaycaptureChromaky = false, NicovideoChromaky = false, AllowDirectView = false, UseFastSpringBone = false, DirectViewMode = false, DirectViewTalk = false, LookingGlass = false, VivesranipalEye = false, VivesranipalBlink = false, VivesranipalX = (decimal)2.0, VivesranipalY = (decimal)1.0, VivesranipalEyeWithEmothion = false, VivesranipalLip = false, ScriptWebSocketConsolePort = 1111, ScriptVrDebug = false, ScriptMoonsharpDebuggerPort = 2222, }; var result = input.ToStructure(); CollectionAssert.AreEqual(new[] { 111, 222 }, result.Niconico.CharacterModels); CollectionAssert.AreEqual(new[] { 123, 456 }, result.Niconico.BackgroundModels); CollectionAssert.AreEqual(new[] { 11, 22 }, result.Niconico.MylistIds); CollectionAssert.AreEqual(new[] { "Foo", "Bar" }, result.Niconico.BroadcasterComments); Assert.AreEqual(-100, result.Niconico.NgScoreThreshold); CollectionAssert.AreEqual(new[] { "http://background.foo/", "http://background.bar/" }, result.Background.Panorama.SourceUrls); CollectionAssert.AreEqual(new[] { "http://image.foo/", "http://image.bar/" }, result.PersistentObject.ImageUrls); CollectionAssert.AreEqual(new[] { "http://dsfrong.bar/" }, result.PersistentObject.DoubleSidedImageUrls.Select(e => e[0]).ToArray()); CollectionAssert.AreEqual(new[] { "http://dsback.bar/" }, result.PersistentObject.DoubleSidedImageUrls.Select(e => e[1]).ToArray()); CollectionAssert.AreEqual(new[] { "http://back.foo/" }, result.PersistentObject.HiddenImageUrls); CollectionAssert.AreEqual(new[] { "http://hdsfront.bar/" }, result.PersistentObject.HiddenDoubleSideImageUrls.Select(e => e[0]).ToArray()); CollectionAssert.AreEqual(new[] { "http://hdsback.bar/" }, result.PersistentObject.HiddenDoubleSideImageUrls.Select(e => e[1]).ToArray()); CollectionAssert.AreEqual(new[] { "tdfoo" }, result.PersistentObject.NicovideoIds); CollectionAssert.AreEqual(new[] { "http://white.foo/" }, result.Item.Whiteboard.SourceUrls); CollectionAssert.AreEqual(new[] { "http://cue.foo/" }, result.Item.CueCard.SourceUrls); Assert.IsFalse(result.Item.HideCameraFromViewrs); Assert.IsFalse(result.Item.EnableDisplaycaptureChromarkey); Assert.IsFalse(result.Item.EnableNicovideoChromakey); Assert.IsNull(result.Item.CaptureFormat); Assert.AreEqual("WQHD", result.Item.CaptureResolution); Assert.IsFalse(result.Studio.AllowDirectView); Assert.IsFalse(result.Humanoid.UseFastSpringBone); Assert.IsNull(result.Mode); Assert.IsFalse(result.DirectViewTalk); Assert.IsFalse(result.EnableLookingGlass); Assert.IsFalse(result.EnableVivesranipalEye); Assert.IsFalse(result.EnableVivesranipalBlink); Assert.AreEqual((decimal)2.0, result.VivesranipalEyeAdjustX); Assert.AreEqual((decimal)1.0, result.VivesranipalEyeAdjustY); Assert.AreEqual(1111, result.EmbeddedScript.WebsocketConsolePort); Assert.IsFalse(result.EnableVivesranipalEyeWithEmothion); Assert.IsFalse(result.EnableVivesranipalLip); Assert.IsFalse(result.EmbeddedScript.VrDebug); Assert.AreEqual(2222, result.EmbeddedScript.MoonsharpDebuggerPort); }