コード例 #1
0
ファイル: TireId_Should.cs プロジェクト: gyankov/Goomer
        public void TypeOfInt()
        {
            var bm = new TirePicture();

            var result = bm.TireId.GetType();

            Assert.True(result == typeof(int));
        }
コード例 #2
0
ファイル: Tire_Should.cs プロジェクト: gyankov/Goomer
        public void BeVirtualProperty()
        {
            var context      = new TirePicture();
            var bindingFlags = BindingFlags.Public | BindingFlags.Instance;

            var commentsProperty = context.GetType().GetProperty("Tire", bindingFlags);

            Assert.That(commentsProperty.GetGetMethod().IsVirtual, Is.True);
        }
コード例 #3
0
        public void AddNewTireAd(string userId, Tire tire, IEnumerable <string> picturesPaths)
        {
            var user = this.usersService.GetById(userId);

            tire.Owner = user;
            this.tiresRepo.Add(tire);

            foreach (var url in picturesPaths)
            {
                var picture = new TirePicture {
                    Url = url, Tire = tire
                };

                tire.Pictures.Add(picture);
            }
            this.uow.Commit();
        }