Esempio n. 1
0
        public void ctor_FileInfo_DateTime()
        {
            using (var temp = new TempDirectory())
            {
                var destination = temp.Info.ToFile("destination");
                var modified = DateTime.UtcNow;

                var obj = new DataFileCreation(destination, modified);

                Assert.Equal(destination, obj.Destination);
                Assert.Equal(modified, obj.Modified);
            }
        }
        public void ctor_FileInfo_DateTime()
        {
            using (var temp = new TempDirectory())
            {
                var destination = temp.Info.ToFile("destination");
                var modified    = DateTime.UtcNow;

                var obj = new DataFileCreation(destination, modified);

                Assert.Equal(destination, obj.Destination);
                Assert.Equal(modified, obj.Modified);
            }
        }
Esempio n. 3
0
        public void op_Create_IEnumerableOfKeyStringDictionary()
        {
            using (var temp = new TempDirectory())
            {
                var destination = temp.Info.ToFile("destination");
                var modified = DateTime.UtcNow;
                var data = new List<KeyStringDictionary>
                               {
                                   new KeyStringDictionary
                                       {
                                           { "VALUE", "123" }
                                       }
                               };

                var obj = new DataFileCreation(destination, modified);
                var count = obj.Create(data);

                Assert.True(temp.Info.ToFile("destination").Exists);
                Assert.Equal(1, count);
                Assert.Equal(count, obj.Count);
                Assert.Equal("123", new CsvDataSheet(destination).First()["VALUE"]);
            }
        }
        public void op_Create_IEnumerableOfKeyStringDictionary()
        {
            using (var temp = new TempDirectory())
            {
                var destination = temp.Info.ToFile("destination");
                var modified    = DateTime.UtcNow;
                var data        = new List <KeyStringDictionary>
                {
                    new KeyStringDictionary
                    {
                        { "VALUE", "123" }
                    }
                };

                var obj   = new DataFileCreation(destination, modified);
                var count = obj.Create(data);

                Assert.True(temp.Info.ToFile("destination").Exists);
                Assert.Equal(1, count);
                Assert.Equal(count, obj.Count);
                Assert.Equal("123", new CsvDataSheet(destination).First()["VALUE"]);
            }
        }