Пример #1
0
        public void CsvFormatItem_Escape_ShouldReturnOK_Comma()
        {
            string test     = "abc123 , next line";
            string returned = CsvFormatItem.Escape(test);

            Assert.AreEqual("\"abc123 , next line\"", returned);
        }
Пример #2
0
        /// <markdown>
        /// ###public string BuildCsvItem()
        /// </markdown>
        /// <summary>
        /// Implementation of the ICsvFormat interface method for building the item
        /// </summary>
        public string BuildCsvItem()
        {
            string item = String.Format("{0},{1},{2}"
                                        , CsvFormatItem.Escape(Id)
                                        , CsvFormatItem.Escape(Name)
                                        , CsvFormatItem.Escape(Email));

            //PI.Net.Http.Formatting.CsvFormatter.Models.CsvFormatItem will take the value and call ToString()
            //it will then clean the string for a CSV file removing line spaces etc
            return(item);
        }
Пример #3
0
        public void CsvFormatItem_Escape_ShouldReturnOK()
        {
            //Arrange
            string test = "abc123";

            //Act
            string result = CsvFormatItem.Escape(test);

            ///Assert
            ///* AreEqual: result = test
            Assert.AreEqual(result, test);
        }
Пример #4
0
        public string BuildCsvItem()
        {
            string item = String.Format("{0},{1},{2},{3}"
                                        , CsvFormatItem.Escape(Cliente_Key)
                                        , CsvFormatItem.Escape(ClienteId)
                                        , CsvFormatItem.Escape(Documento)
                                        , CsvFormatItem.Escape(Nombre));

            //PI.Net.Http.Formatting.CsvFormatter.Models.CsvFormatItem will take the value and call ToString()
            //it will then clean the string for a CSV file removing line spaces etc
            return(item);
        }
Пример #5
0
        public void CsvFormatItem_Escape_ShouldReturnOK_SlashR()
        {
            //Arrange
            string test = "abc123 \r next line";

            //Act
            string result = CsvFormatItem.Escape(test);

            ///Assert
            string expected = "\"abc123 \r next line\"";

            ///* AreEqual: result = expected
            Assert.AreEqual(result, expected);
        }
Пример #6
0
        public string BuildCsvItem()
        {
            string item = String.Format("{0},{1},{2},{3},{4},{5},{6}"
                                        , CsvFormatItem.Escape(Producto_Key)
                                        , CsvFormatItem.Escape(ProductoId)
                                        , CsvFormatItem.Escape(Codigo)
                                        , CsvFormatItem.Escape(Nombre)
                                        , CsvFormatItem.Escape(Marca)
                                        , CsvFormatItem.Escape(Grupo)
                                        , CsvFormatItem.Escape(SubGrupo));

            //PI.Net.Http.Formatting.CsvFormatter.Models.CsvFormatItem will take the value and call ToString()
            //it will then clean the string for a CSV file removing line spaces etc
            return(item);
        }
Пример #7
0
        public string BuildCsvItem()
        {
            string item = String.Format("{0},{1},{2},{3},{4},{5},{6}"
                                        , CsvFormatItem.Escape(Tiempo_Key)
                                        , CsvFormatItem.Escape(Fecha)
                                        , CsvFormatItem.Escape(Año)
                                        , CsvFormatItem.Escape(Mes)
                                        , CsvFormatItem.Escape(Dia)
                                        , CsvFormatItem.Escape(Hora)
                                        , CsvFormatItem.Escape(Minuto));

            //PI.Net.Http.Formatting.CsvFormatter.Models.CsvFormatItem will take the value and call ToString()
            //it will then clean the string for a CSV file removing line spaces etc
            return(item);
        }
Пример #8
0
        public string BuildCsvItem()
        {
            string item = String.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8}"
                                        , CsvFormatItem.Escape(Cliente_Key)
                                        , CsvFormatItem.Escape(Empleado_Key)
                                        , CsvFormatItem.Escape(Producto_Key)
                                        , CsvFormatItem.Escape(Tiempo_Key)
                                        , CsvFormatItem.Escape(Precio)
                                        , CsvFormatItem.Escape(Cantidad)
                                        , CsvFormatItem.Escape(Monto)
                                        , CsvFormatItem.Escape(RecargoUsoTarjeta)
                                        , CsvFormatItem.Escape(MontoTotal));

            //PI.Net.Http.Formatting.CsvFormatter.Models.CsvFormatItem will take the value and call ToString()
            //it will then clean the string for a CSV file removing line spaces etc
            return(item);
        }