public void ShouldUpdate_WhenModelIsNullAndETagNotUsed_ReturnsTrue() { ETagRequestService service = GetService(); var shouldUpdate = service.ShouldUpdate(null); Assert.IsTrue(shouldUpdate); }
public void ShouldUpdate_WhenETagNotUsed_ReturnsTrue() { ETagRequestService service = GetService(); var shouldUpdate = service.ShouldUpdate(new object()); Assert.IsTrue(shouldUpdate); }
public void ShouldUpdate_WhenETagDoesNotMatch_ReturnsFalse() { var mockETagService = new Mock <IETagService>(); mockETagService.Setup(e => e.CheckETags(It.IsAny <string>(), It.IsAny <object>())) .Returns(ETagMatchResult.DoNotMatch); ETagRequestService service = GetService(mockETagService, ifMatchHeader: "a"); var shouldUpdate = service.ShouldUpdate(new object()); Assert.IsFalse(shouldUpdate); }
public void ShouldUpdate_WhenModelIsNullAndETagIsUsed_ThrowsArgumentNullException() { ETagRequestService service = GetService(ifMatchHeader: "a"); Assert.Throws <ArgumentNullException>(() => service.ShouldUpdate(null)); }