Esempio n. 1
0
        public void WriteRecordTest()
        {
            var sb = new StringBuilder();

            using (var stringWriter = new StringWriter(sb))
                using (var ltsvWriter = new LtsvWriter(stringWriter))
                {
                    ltsvWriter.WriteRecord(new Player()
                    {
                        Number   = 10,
                        Name     = "Kagawa",
                        Position = "MF",
                    });
                }

            Assert.Equal("Number:10\tName:Kagawa\tPosition:MF\r\n", sb.ToString());
        }
Esempio n. 2
0
        public void FluentClassMappingTest()
        {
            var configuration = new LtsvConfiguration();

            configuration.RegisterClassMap <PlayerMap>();

            var sb = new StringBuilder();

            using (var stringWriter = new StringWriter(sb))
                using (var ltsvWriter = new LtsvWriter(stringWriter, configuration))
                {
                    ltsvWriter.WriteRecord(new Player()
                    {
                        Number   = 10,
                        Name     = "Kagawa",
                        Position = "MF",
                    });
                }

            Assert.Equal("Name:Kagawa\tNo:10\r\n", sb.ToString());
        }