Beispiel #1
0
        public void LocationModelExtensionsClassToLocationMethodReturnsObjectWithCorrectFontTypeProperty()
        {
            LocationFontType testFontType = GetRandomLocationFontType();
            LocationModel    testObject   = new LocationModel {
                FontTypeName = testFontType.ToString("g")
            };

            Location result = testObject.ToLocation();

            Assert.AreEqual(testFontType, result.FontType);
        }
        public static LocationFontType NextLocationFontType(this Random random)
        {
            if (random == null)
            {
                throw new NullReferenceException();
            }

            LocationFontType[] allValues = new LocationFontType[]
            {
                LocationFontType.Condensed,
                LocationFontType.Normal,
            };

            return(allValues[random.Next(allValues.Length)]);
        }