public void Given_I_Call_FieldExists_Then_The_Correct_Services_Are_Called(FieldNameType fieldNameType) { //arrange var dataModelMock = new Mock <IDatamodel>(); dataModelMock.As <IDefinitionScope2>(); dataModelMock.As <IDefinitionScope2>().Setup(d => d.FieldExists(fieldNameType.ToString())).Returns(It.IsAny <bool>()); _dataModelServiceMock.Setup(d => d.GetDataModel(_connectionModel, It.IsAny <string>(), It.IsAny <string>())) .Returns(dataModelMock.Object); //act _sut.FieldExists(_connectionModel, _instrumentName, _serverParkName, fieldNameType); //assert _dataModelServiceMock.Verify(d => d.GetDataModel(_connectionModel, _instrumentName, _serverParkName), Times.Once); }