示例#1
0
        public void ConverterDefaultValues()
        {
            var converter = new DynamoConverter();

            Assert.NotNull(converter);

            Assert.AreEqual(ConversionMetricUnit.Length, converter.SelectedMetricConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedToConversion);
        }
示例#2
0
        public void ConverterItemSourceCount()
        {
            var converter = new DynamoConverter()
            {
                SelectedMetricConversion = ConversionMetricUnit.Volume
            };

            Assert.NotNull(converter);

            Assert.AreEqual("8", ((dynamic)converter.SelectedFromConversionSource).Count.ToString());
            Assert.AreEqual("8", ((dynamic)converter.SelectedToConversionSource).Count.ToString());
        }
示例#3
0
        public void SetConverterValues()
        {
            var converter = new DynamoConverter()
            {
                SelectedMetricConversion = ConversionMetricUnit.Area
            };

            Assert.NotNull(converter);

            Assert.AreEqual(ConversionMetricUnit.Area, converter.SelectedMetricConversion);
            Assert.AreEqual(ConversionUnit.SquareMeter, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.SquareMeter, converter.SelectedToConversion);
        }
示例#4
0
        public void ConvertSetConversionToValue()
        {
            var converter = new DynamoConverter()
            {
                SelectedMetricConversion = ConversionMetricUnit.Volume
            };

            Assert.NotNull(converter);

            Assert.AreEqual(ConversionMetricUnit.Volume, converter.SelectedMetricConversion);
            Assert.AreEqual(ConversionUnit.CubicMeters, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.CubicMeters, converter.SelectedToConversion);

            converter.SelectedToConversion = ConversionUnit.CubicInches;
            Assert.AreEqual(ConversionUnit.CubicMeters, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.CubicInches, converter.SelectedToConversion);
        }
示例#5
0
        public void ConvertSetConversionFromValue()
        {
            var converter = new DynamoConverter()
            {
                SelectedMetricConversion = ConversionMetricUnit.Length
            };

            Assert.NotNull(converter);

            Assert.AreEqual(ConversionMetricUnit.Length, converter.SelectedMetricConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedToConversion);

            converter.SelectedFromConversion = ConversionUnit.Feet;
            Assert.AreEqual(ConversionUnit.Feet, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedToConversion);
        }
示例#6
0
        public void ConverterTestToggleState()
        {
            var converter = new DynamoConverter()
            {
                SelectedMetricConversion = ConversionMetricUnit.Length
            };

            Assert.NotNull(converter);

            Assert.AreEqual(ConversionMetricUnit.Length, converter.SelectedMetricConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedToConversion);

            converter.SelectedFromConversion = ConversionUnit.Feet;
            Assert.AreEqual(ConversionUnit.Feet, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedToConversion);

            converter.ToggleDropdownValues();
            Assert.AreEqual(ConversionUnit.Meters, converter.SelectedFromConversion);
            Assert.AreEqual(ConversionUnit.Feet, converter.SelectedToConversion);
        }
示例#7
0
        public void CanConstructConverterNode()
        {
            var converter = new DynamoConverter();

            Assert.NotNull(converter);
        }