Ejemplo n.º 1
0
        public void SetBrand_VehicleDoesNotContainBrand_VehicleHasBrandName()
        {
            Domain.Aggregates.Vehicle vehicle = new Domain.Aggregates.Vehicle("118");
            Domain.Entities.Brand     brand   = new Domain.Entities.Brand("BMW");
            vehicle.SetBrand(brand);

            Assert.AreEqual("BMW", vehicle.Brand.Name);
        }
Ejemplo n.º 2
0
        public void Create_NewCar_VehicleHasBrand()
        {
            Domain.Entities.VehicleType vType   = new Domain.Entities.VehicleType("Cabriolet");
            Domain.Entities.Brand       brand   = new Domain.Entities.Brand("BMW");
            Domain.Aggregates.Vehicle   vehicle = new Domain.Aggregates.Vehicle("118", vType, brand);

            Assert.AreEqual("BMW", vehicle.Brand.Name);
        }
Ejemplo n.º 3
0
        public async Task Create(BrandDto dto)
        {
            var brand = new Domain.Entities.Brand
            {
                Name        = dto.Name,
                ErasedState = false
            };

            await _brandRepository.Create(brand);
        }
Ejemplo n.º 4
0
        public async Task <long> Handle(CreateBrandCommand request, CancellationToken cancellationToken)
        {
            var brand = new Domain.Entities.Brand()
            {
                Name = request.Name
            };

            await _brandRepository.Add(brand);

            return(brand.Id);
        }
Ejemplo n.º 5
0
 public void Create_NewBrand_BrandHasName()
 {
     Domain.Entities.Brand brand = new Domain.Entities.Brand("BMW");
     Assert.AreEqual("BMW", brand.Name);
 }