public void IsDebugTrueの時のToReg出力(CtrlType ctrlType, bool isDebug, String str, String expected) { //setUp OneVal sut = Assistance.CreateOneVal(ctrlType, str); //exercise String actual = sut.ToReg(isDebug); //verify Assert.That(actual, Is.EqualTo(expected)); }
public void FromRegで設定した値をtoRegで取り出す(CtrlType ctrlType, String str) { //setUp const bool isSecret = false; OneVal sut = Assistance.CreateOneVal(ctrlType, null); sut.FromReg(str); var expected = str; //exercise String actual = sut.ToReg(isSecret); //verify Assert.That(actual, Is.EqualTo(expected)); }
public void 設定ファイルにテキストでセットしてreadして当該設定が読み込めるかどうか(CtrlType ctrlType, string value, string regStr) { //setUp string fileName = "iniDbTestTmp"; //テンポラリファイル名 //string progDir = new File(".").getAbsoluteFile().getParent(); string progDir = Directory.GetCurrentDirectory(); string path = string.Format("{0}\\{1}.ini", progDir, fileName); IniDb sut = new IniDb(progDir, fileName); sut.Delete(); String expected = value; //exercise List <string> lines = new List <string>(); lines.Add(regStr); File.WriteAllLines(path, lines); ListVal listVal = new ListVal(); listVal.Add(Assistance.createOneVal(ctrlType, null)); sut.Read("Basic", listVal); // nameTagは"Basic"で決め打ちされている OneVal oneVal = listVal.Search("name"); string actual = oneVal.ToReg(false); //verify Assert.That(actual, Is.EqualTo(expected)); //TearDown sut.Delete(); }