public void GetPointByCodeQuery_Ok() { //Arrenge string code = "test"; GetPointByCodeQueryRequest request = new GetPointByCodeQueryRequest { Code = code }; _pointdataMock.Setup(p => p.GetPointByCode(It.IsIn(code))) .Returns(new Point { Code = code, Description = "Point Test" }); //Act Point point = new GetPointByCodeQuery(_pointdataMock.Object).Execute(request); //Assert _pointdataMock.Verify(p => p.GetPointByCode(It.IsIn(code)), Times.Once); Assert.AreEqual(code, point.Code); Assert.AreEqual("Point Test", point.Description); }
public void GetPointByCodeQuery_InvalidId_ThrowResponseException400() { //Arrenge GetPointByCodeQueryRequest request = new GetPointByCodeQueryRequest { Code = "test" }; _pointdataMock.Setup(p => p.GetPointByCode(It.IsAny <string>())); //Act new GetPointByCodeQuery(_pointdataMock.Object).Execute(request); }