示例#1
0
 public void WriteFileAndGetItsValue()
 {
     var _sut = new FileProperties ();
     _sut.SetValue ("key1", "hoge");
     _sut.WriteToFile ("sample_actual.txt");
     FileAssert.AreEqual ("../../TestData/sample_expected.txt", "sample_actual.txt");
 }
示例#2
0
        public void SetValueCanDealMultiValue()
        {
            var _sut = new FileProperties ();
            _sut.SetValue ("key0", "value0");
            _sut.SetValue ("key1", "value1");
            _sut.WriteToFile ("actual_multi_value.txt");

            FileAssert.AreEqual("../../TestData/expected_multi_value.txt", "actual_multi_value.txt");
        }
示例#3
0
        public void OriginalFileIOTest()
        {
            IFileIO fileo = new FileProperties ();
            fileo.SetValue ("Year", "2013");
            fileo.SetValue ("Month", "05");
            fileo.SetValue ("Day", "02");
            fileo.WriteToFile ("FileIOExample.txt");

            IFileIO filei = new FileProperties ();
            filei.ReadFromFile("FileIOExample.txt");
            Console.WriteLine (filei.GetValue ("Year"));
            Console.WriteLine (filei.GetValue ("Month"));
            Console.WriteLine (filei.GetValue ("Day"));
        }
示例#4
0
 public void WhenSetValueThenGetValueReturnsValue(string key,string value)
 {
     var _sut = new FileProperties ();
     _sut.SetValue (key, value);
     Assert.That (_sut.GetValue (key), Is.EqualTo (value));
 }
示例#5
0
 public void ReadFromFileTests(string fileName, string key, string expected)
 {
     var _sut = new FileProperties ();
     _sut.ReadFromFile (fileName);
     Assert.That (_sut.GetValue (key), Is.EqualTo (expected));
 }
示例#6
0
 public void GetValueReturnsAddedKeyValue(string key, string expected)
 {
     var _sut = new FileProperties ();
     Assert.That (_sut.GetValue(key), Is.EqualTo (expected));
 }