Exemplo n.º 1
0
        public void ShouldBeAbleToThrowArgumentExeptionWhenUpdatingReward()
        {
            InMemoryStorage storage       = new InMemoryStorage();
            RewardModel     illegalReward = new RewardModel
            {
                Id          = -1,
                Title       = "1",
                Description = "1"
            };

            Assert.Throws <ArgumentException>(() => storage.UpdateReward(illegalReward));
        }
Exemplo n.º 2
0
        public void ShouldBeAbleToUpdateRewardsTitle()
        {
            InMemoryStorage storage        = new InMemoryStorage();
            int             testedRewardId = 1;
            string          testedTitle    = "test";
            RewardModel     testReward     = new RewardModel
            {
                Id          = testedRewardId,
                Title       = testedTitle,
                Description = ""
            };

            bool result        = storage.UpdateReward(testReward);
            var  changedReward = storage.GetRewardsList().FirstOrDefault(x => x.Id == testedRewardId);

            Assert.True(result);
            Assert.NotNull(changedReward);
            Assert.Equal(changedReward.Title, testedTitle);
        }
Exemplo n.º 3
0
        public void ShouldBeAbleToThrowArgumentNullExeptionWhenUpdatingReward()
        {
            InMemoryStorage storage = new InMemoryStorage();

            Assert.Throws <ArgumentNullException>(() => storage.UpdateReward(null));
        }