Пример #1
0
        public void CreateGrmEventWithInvalidCreateInput()
        {
            var grmEventListCreate = CreateMockDto();

            grmEventListCreate.GrmEventList[0].RevenueObjectId = -1;

            Should.Throw <BadRequestException>(() => _grmEventDomain.CreateGrmEvents(grmEventListCreate));
            ;
        }
Пример #2
0
        public void CreateGrmEventWithValidCreateInput()
        {
            var grmEventListCreate = CreateMockDto();
            var moqRepository      = new Mock <IGrmEventRepository>();

            moqRepository.Setup(x => x.CreateGrmEvents(It.IsAny <IEnumerable <GrmEventComponentCreate> >())).Returns(Mapping.Mappers.ToEntity(grmEventListCreate.GrmEventList));
            var grmEventDomain = new GrmEventDomain(moqRepository.Object);

            var grmEventListResult = grmEventDomain.CreateGrmEvents(grmEventListCreate);

            grmEventListResult.ShouldNotBeNull();
            grmEventListResult.GrmEventList.Count.ShouldBe(1);
        }