Beispiel #1
0
        public void InitializePicturesCorrectly()
        {
            var rim = new RimWithTire();

            var pictures = rim.Pictures;

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

            var result = rim.GrappleMm.GetType();

            Assert.True(result == typeof(double));
        }
        public void TypeOfDouble()
        {
            var rim = new RimWithTire();

            var result = rim.CentralHoleSize.GetType();

            Assert.True(result == typeof(double));
        }
Beispiel #4
0
        public void TypeOfDoubel()
        {
            var rim = new RimWithTire();

            var result = rim.Height.GetType();

            Assert.True(result == typeof(double));
        }
Beispiel #5
0
        public void TypeOfInt()
        {
            var rim = new RimWithTire();

            var result = rim.SpeedIndex.GetType();

            Assert.True(result == typeof(int));
        }
Beispiel #6
0
        public void TypeOfDouble()
        {
            var rim = new RimWithTire();

            var result = rim.SpaceBetweenBolts.GetType();

            Assert.True(result == typeof(double));
        }
Beispiel #7
0
        public void TypeOfInt()
        {
            var rim = new RimWithTire();

            var result = rim.NumberOfBolts.GetType();

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

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

            Assert.True(result == typeof(string));
        }
Beispiel #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);
        }
        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);
        }
Beispiel #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);
        }
Beispiel #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();
        }
Beispiel #13
0
        public void CreateInstanceOfBaseModel()
        {
            var rim = new RimWithTire();

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

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