public IEnumerable <DataEntrySettingsModel> GetSurveyDataEntrySettings(string instrumentName, string serverParkName) { instrumentName.ThrowExceptionIfNullOrEmpty("instrumentName"); serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName"); return(_surveyMetaService.GetSurveyDataEntrySettings(_connectionModel, instrumentName, serverParkName)); }
public void Given_I_Call_GetSurveyDataEntrySettings_I_Get_A_List_Of_SurveyEntrySettingsModel_Back() { //arrange var dataEntrySettingsList = new List <IDataEntrySettings>(); var dataEntrySettingsCollection = new Mock <IDataEntrySettingsCollection>(); dataEntrySettingsCollection.Setup(des => des.GetEnumerator()) .Returns(dataEntrySettingsList.GetEnumerator()); var datamodelMock = new Mock <IDatamodel>(); datamodelMock.Setup(d => d.DataEntrySettings).Returns(dataEntrySettingsCollection.Object); _dataModelServiceMock.Setup(dm => dm.GetDataModel(It.IsAny <ConnectionModel>(), It.IsAny <string>(), It.IsAny <string>())).Returns(datamodelMock.Object); //act var result = _sut.GetSurveyDataEntrySettings(_connectionModel, _instrumentName, _serverParkName); //assert Assert.IsNotNull(result); Assert.IsInstanceOf <List <DataEntrySettingsModel> >(result); }