Ejemplo n.º 1
0
        public HttpResponseMessage GetById(HttpRequestMessage request, int activityId)
        {
            var cardActivity = new CardActivity();

            var result = cardActivity.Get(activityId);

            return request.CreateResponse(HttpStatusCode.OK, result);
        }
Ejemplo n.º 2
0
            public void WhenGet_ShouldNotBeNull()
            {
                DateTime NOW = new DateTime(2014, 6, 13);

                CardActivity subject = null;

                var storageProvider = new Mock<IStorageProvider>();
                storageProvider
                    .Setup(d => d.GetCardActivity(It.Is<int>(i => i == 1)))
                    .Returns(() => new CardActivity() { ID = 22, CardID = 3, ActivityType = CardActivityType.Modify.ToString(), LoggedDate = NOW, LoggedUser = "******" });

                CardActivity cardActivity = new CardActivity(storageProvider.Object, null);

                subject = cardActivity.Get(1);

                subject.Should().NotBeNull();
            }