Beispiel #1
0
        public async Task TestDeleteDateMobile()
        {
            Mock <IDateRepository> mock       = new Mock <IDateRepository>();
            DateMobileController   controller = new DateMobileController(mock.Object);

            DateMobile date = new DateMobile()
            {
                Id = new Guid()
            };

            mock.Setup(t => t.Delete(It.IsAny <DateMobile>())).Verifiable();

            await controller.DeleteDate(date);

            mock.VerifyAll();
        }
Beispiel #2
0
        public async Task TestDeleteDateMobileNull()
        {
            Mock <IDateRepository> mock       = new Mock <IDateRepository>();
            DateMobileController   controller = new DateMobileController(mock.Object);

            DateMobile date = null;

            ArgumentNullException exception = await Assert.ThrowsExceptionAsync <ArgumentNullException>(() => controller.DeleteDate(date));

            Assert.AreEqual(exception.ParamName, nameof(date));
        }