Example #1
0
 public CreateSubscriptionInput(long typeId, long clientId, long placeId, DateTime latestRenewal, bool fixedContract, domain.SubscriptionType type)
 {
     TypeId        = typeId;
     ClientId      = clientId;
     PlaceId       = placeId;
     LatestRenewal = latestRenewal;
     FixedContract = fixedContract;
     Type          = type;
 }
        public void ShouldUpdateSubscriptionType()
        {
            var subType         = new domain.SubscriptionType(0, "test", 8, 5, 3, 30, 25, 200, 280, "description");
            var mockSubTypeRepo = new Mock <ISubscriptionTypeRepository>();

            mockSubTypeRepo.Setup(m => m.Update(subType)).Returns(0);

            var res = new UpdateSubscriptionType(mockSubTypeRepo.Object, subType).Execute();

            Assert.AreEqual(0, res);
        }
Example #3
0
        public void ShouldFailGettingSubscriptionById()
        {
            var subType         = new domain.SubscriptionType(0, "test", 8, 5, 3, 30, 25, 200, 280, "description");
            var mockSubTypeRepo = new Mock <ISubscriptionTypeRepository>();

            mockSubTypeRepo.Setup(m => m.GetById(0)).Returns(subType);

            var res = new GetSubscriptionTypeById(mockSubTypeRepo.Object, 1).Execute();

            Assert.IsNull(res);
        }
        public void ShouldFailCreatingSubscriptionType()
        {
            var subType         = new domain.SubscriptionType(0, "test", 8, 5, 3, 30, 25, 200, 280, "description");
            var mockSubTypeRepo = new Mock <ISubscriptionTypeRepository>();

            mockSubTypeRepo.Setup(m => m.Create(It.IsAny <domain.SubscriptionType>())).Returns(-1);

            var res = new CreateSubscriptionType(mockSubTypeRepo.Object, subType).Execute();

            Assert.AreEqual(-1, res);
        }
 public UpdateSubscriptionType(ISubscriptionTypeRepository subscriptionTypeRepository, domain.SubscriptionType subscriptionType)
 {
     this.subscriptionTypeRepository = subscriptionTypeRepository;
     SubscriptionType = subscriptionType;
 }