DoubleToIntConverterTest.cs 606 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Text;
  5. using PixiEditor.Helpers.Converters;
  6. using Xunit;
  7. namespace PixiEditorTests.HelpersTests.ConvertersTests
  8. {
  9. public class DoubleToIntConverterTest
  10. {
  11. [Fact]
  12. public void TestThatConvertConvertsDoubleToInt()
  13. {
  14. DoubleToIntConverter converter = new DoubleToIntConverter();
  15. var value = converter.Convert(5.123, typeof(int), null, CultureInfo.CurrentCulture);
  16. Assert.IsType<int>(value);
  17. Assert.Equal(5, (int)value);
  18. }
  19. }
  20. }