Exemple #1
0
        public CriacaoModeloDomainServiceTest()
        {
            _marcaTestBuilder = new MarcaTestBuilder();
            _marca            = _marcaTestBuilder
                                .ComId(3333)
                                .AdicionaModelo(4441, "Corolla", DateTime.Today)
                                .AdicionaModelo(4442, "Yaris", DateTime.Today)
                                .AdicionaModelo(4443, "Etios", DateTime.Today)
                                .AdicionaModelo(4444, "Hillux", DateTime.Today)
                                .Build();



            timeProvider = new Mock <ITimeProvider>();
            timeProvider.Setup(q => q.UtcNow).Returns(DateTime.Today);

            idGen = new Mock <IIdGeneratorService <long> >();
            idGen.Setup(q => q.GenerateId()).Returns(5165161);

            marcaRepository = new Mock <IMarcaRepository>();
            marcaRepository.Setup(q => q.ObterPorIdAsync(_marca.MarcaId)).Returns(Task.FromResult(_marca));
            marcaRepository.Setup(q => q.ObterPorIdAsync(44444)).Returns(Task.FromResult(default(Marca)));

            modeloRepository = new Mock <IModeloRepository>();
        }
Exemple #2
0
 public ModeloTests()
 {
     _modeloTestBuilder = new ModeloTestBuilder();
     _marcaTestBuilder  = new MarcaTestBuilder();
 }
 public MarcaTests()
 {
     _marcaBuilder = new MarcaTestBuilder();
 }