public void FormatLastPassValidTemperature(TemperatureUnitEnum temperatureUnits, ushort value, string expectedResult) { var userPreferences = new UserPreferences() { TemperatureUnits = (int)temperatureUnits }; var csvUserPreference = AutoMapperUtility.Automapper.Map <CSVExportUserPreferences>(userPreferences); var formatter = new CSVExportFormatter(csvUserPreference, OutputTypes.PassCountLastPass); var result = formatter.FormatLastPassValidTemperature(value); result.Should().Be(expectedResult); }
public void CSVExportHelper_MapUserPreferences(string decimalSeparator, string thousandsSeparator, UnitsTypeEnum units, string dateSeparator, string timeSeparator, TemperatureUnitEnum temperatureUnits, string expectedDateSeparator, string expectedTimeSeparator) { var userPreference = new UserPreferences() { DateSeparator = dateSeparator, TimeSeparator = timeSeparator, DecimalSeparator = decimalSeparator, ThousandsSeparator = thousandsSeparator, Units = (int)units, TemperatureUnits = (int)temperatureUnits }; var csvUserPreference = AutoMapperUtility.Automapper.Map <CSVExportUserPreferences>(userPreference); csvUserPreference.DecimalSeparator.Should().Be(decimalSeparator); csvUserPreference.ThousandsSeparator.Should().Be(thousandsSeparator); csvUserPreference.Units.Should().Be(units); csvUserPreference.TemperatureUnits.Should().Be(temperatureUnits); csvUserPreference.DateSeparator.Should().Be(expectedDateSeparator); csvUserPreference.TimeSeparator.Should().Be(expectedTimeSeparator); }