コード例 #1
0
        public void Should_Create_FeedstockId_Whithout_Id()
        {
            var feedstockId = FeedstockId.New();

            Assert.True(Guid.TryParse(feedstockId.Value.ToString(), out var _));
            Assert.NotEqual(Guid.Empty, feedstockId.Value);
        }
コード例 #2
0
        /// <summary>
        /// This constructor contains some fields of Measure <see cref="Feedstock"/>.
        /// </summary>
        /// <param name="name">Name of measure.</param>
        /// <param name="status">Status of register.</param>
        /// <param name="measureId">Measure Id.</param>
        /// <param name="stock">Quantity in stock.</param>
        /// <param name="colorId">Id of color.</param>
        /// <param name="tenantId">Cliente Id.</param>
        /// <returns>Returns new instance of Measure <see cref="Feedstock"/></returns>
        public static Feedstock New(
            string name,
            Status status,
            MeasureId measureId,
            int stock,
            ColorId colorId,
            TenantId tenantId)
        {
            var feedstock = new Feedstock
            {
                Name         = name,
                Status       = status,
                CreationDate = DateTime.Now,
                UpdateDate   = null,
                MeasureId    = measureId,
                Stock        = stock,
                ColorId      = colorId,
                TenantId     = tenantId,
                FeedstockId  = FeedstockId.New()
            };

            feedstock.Isvalid();

            return(feedstock);
        }
コード例 #3
0
        public async Task Should_Get_Feedstock()
        {
            var getFeedstockQueryHandler = new GetFeedstockQueryHandler(_feedstockRepository);
            var request = GetFeedstockQueryRequest.New(FeedstockId.New());

            var feedstockDto = await getFeedstockQueryHandler.Handle(request, new CancellationToken());

            Assert.NotNull(feedstockDto);
        }
コード例 #4
0
 public FeedstockTest()
 {
     _feedstockName = "leather";
     _status        = StatusEnum.Enable;
     _measureId     = MeasureId.New();
     _tenantId      = TenantId.New();
     _colorId       = ColorId.New();
     _stock         = 10;
     _feedstockId   = FeedstockId.New();
     _creationDate  = DateTime.Now;
     _updateDate    = DateTime.Now.AddHours(1);
     _feedstock     = Domain.Entities.Feedstock.New(_feedstockName, _status, _measureId, _stock, _colorId, _tenantId);
 }
コード例 #5
0
 public void Should_Not_Create_FeedstockIdd_When_Id_Is_Empty()
 {
     Assert.Throws <Exception>(() => FeedstockId.New(Guid.Empty));
 }