Пример #1
0
        public void InitializePicturesCorrectly()
        {
            var rim = new RimWithTire();

            var pictures = rim.Pictures;

            Assert.That(pictures, Is.Not.Null.And.InstanceOf <HashSet <RimWithTirePicture> >());
        }
Пример #2
0
        public void TypeOfDouble()
        {
            var rim = new RimWithTire();

            var result = rim.GrappleMm.GetType();

            Assert.True(result == typeof(double));
        }
Пример #3
0
        public void TypeOfDouble()
        {
            var rim = new RimWithTire();

            var result = rim.CentralHoleSize.GetType();

            Assert.True(result == typeof(double));
        }
Пример #4
0
        public void TypeOfDoubel()
        {
            var rim = new RimWithTire();

            var result = rim.Height.GetType();

            Assert.True(result == typeof(double));
        }
Пример #5
0
        public void TypeOfInt()
        {
            var rim = new RimWithTire();

            var result = rim.SpeedIndex.GetType();

            Assert.True(result == typeof(int));
        }
Пример #6
0
        public void TypeOfDouble()
        {
            var rim = new RimWithTire();

            var result = rim.SpaceBetweenBolts.GetType();

            Assert.True(result == typeof(double));
        }
Пример #7
0
        public void TypeOfInt()
        {
            var rim = new RimWithTire();

            var result = rim.NumberOfBolts.GetType();

            Assert.True(result == typeof(int));
        }
Пример #8
0
        public void TypeOfString(string test)
        {
            var bm = new RimWithTire();

            bm.WeightIndex = test;
            var result = bm.WeightIndex.GetType();

            Assert.True(result == typeof(string));
        }
Пример #9
0
        public void HaveStringLengthAttributeAttribute()
        {
            var bm = new RimWithTire();

            var result = bm
                         .GetType()
                         .GetProperty("WeightIndex")
                         .GetCustomAttributes(false)
                         .Where(x => x.GetType() == typeof(System.ComponentModel.DataAnnotations.StringLengthAttribute))
                         .Any();

            Assert.True(result);
        }
Пример #10
0
        public void HaveRequiredAttribute()
        {
            var rim = new RimWithTire();

            var result = rim
                         .GetType()
                         .GetProperty("CentralHoleSize")
                         .GetCustomAttributes(false)
                         .Where(x => x.GetType() == typeof(System.ComponentModel.DataAnnotations.RequiredAttribute))
                         .Any();

            Assert.True(result);
        }
Пример #11
0
        public void HaveRangeAttribute()
        {
            var rim = new RimWithTire();

            var result = rim
                         .GetType()
                         .GetProperty("SpaceBetweenBolts")
                         .GetCustomAttributes(false)
                         .Where(x => x.GetType() == typeof(System.ComponentModel.DataAnnotations.RangeAttribute))
                         .Any();

            Assert.True(result);
        }
Пример #12
0
        public void AddNewTireAd(string userId, RimWithTire rimWithTire, IEnumerable <string> picturesPaths)
        {
            var user = this.usersService.GetById(userId);

            rimWithTire.Owner = user;
            this.rimWithTireRepo.Add(rimWithTire);

            foreach (var url in picturesPaths)
            {
                var picture = new RimWithTirePicture {
                    Url = url, RimWithTire = rimWithTire
                };

                rimWithTire.Pictures.Add(picture);
            }
            this.uow.Commit();
        }
Пример #13
0
        public void CreateInstanceOfBaseModel()
        {
            var rim = new RimWithTire();

            Assert.That(rim, Is.InstanceOf <BaseModel>());
        }
Пример #14
0
        public void CreateInstanceOfITire()
        {
            var rim = new RimWithTire();

            Assert.That(rim, Is.InstanceOf <ITire>());
        }