public WordMatrixService() { _rulesRepository = new RulesRepository(); _valuesRepository = new ValuesRepository(); _wordsRepository = new WordsRepository(); _cypherRepository = new CypherRepository(); }
public void ReturnsSpecificValues() { var repository = new ValuesRepository(); var value = repository.GetById(0); Assert.AreEqual("value", value); }
public void ReturnsAllValues() { var repository = new ValuesRepository(); var values = repository.GetAll(); Assert.AreEqual(2, values.Count()); }
//=============================== //private readonly ValuesRepository _repository; //public ValuesController(ValuesRepository repository) //{ // this._repository = repository ?? throw new ArgumentNullException(nameof(repository)); //} //=============================== public ValuesController(IDataProtectionProvider protectionProvider, HashService hashService, ValuesRepository repository) { _protector = protectionProvider.CreateProtector("valor_unico_y_quizas_secreto"); _hashService = hashService; //==================PROCEDIMIENTO ALMACENADO _repository = repository ?? throw new ArgumentNullException(nameof(repository)); }
public void GetValueBadId() { var _repo = new ValuesRepository(); var _results = _repo.GetOne(Guid.NewGuid()); Assert.IsNull(_results); }
public void SetUp() { _dbContext = new Mock <ValuesContext>(); _dbContext.Setup(context => context.Values.Add(It.IsAny <ValueRecord>())); var subject = new ValuesRepository(_dbContext.Object); subject.Add(234); }
public void Get() { var repo = new ValuesRepository(); var id = 10; for (var i = 0; i < id; i++) { var val = repo.GetNext(); EventSourceAttribute.StreamWrapper.Write(val, "value"); } }
public async Task Pass_Data_With_Put_Request() { const string expectedName = "John Smith"; var id = Guid.NewGuid(); var user = new { name = expectedName }; await Api .When() .Post($"putNameToValues_PUT/{id}", user) .Then() .Status(HttpStatusCode.OK); Assert.Equal(expectedName, ValuesRepository.Get(id)); }
public void CreateNewValue() { var _repo = new ValuesRepository(); var _newValue = new ValueModel(); _newValue.Name = "Joe"; _newValue.Id = Guid.NewGuid(); _repo.Save(_newValue); var _result = _repo.GetOne(_newValue.Id); Assert.IsNotNull(_result); }
public async Task Verify_Response_From_Delete_Request() { var id = AddTestValue("test-value"); Assert.True(ValuesRepository.HasValue(id)); await Api .When() .Delete($"deleteValueById/{id}") .Then() .Status(HttpStatusCode.OK); Assert.False(ValuesRepository.HasValue(id)); }
/// <summary> /// Implementation of the IOhmValueCalculator interface for calculating the Ohm value of a resistor based on the band colors. /// </summary> /// <param name="bandAColor"></param> /// <param name="bandBColor"></param> /// <param name="bandCColor"></param> /// <param name="bandDColor"></param> /// <returns></returns> public int CalculateOhmValue(string bandAColor, string bandBColor, string bandCColor, string bandDColor) { ValuesRepository valuesRepository = new ValuesRepository(); int result = 0; Dictionary <string, int> a = valuesRepository.a; Dictionary <string, int> b = valuesRepository.b; Dictionary <string, int> c = valuesRepository.c; Dictionary <string, float> d = valuesRepository.d; var calc = (a[bandAColor] * 10 + b[bandBColor]) * Math.Pow(10, c[bandCColor]) * (1 + d[bandDColor]); result = Convert.ToInt32(calc); return(result); }
/// public HomeController() { valuesRepository = new ValuesRepository(); ohmViewModel = new OhmViewModel { BandA = new List <SelectListItem>(), BandB = new List <SelectListItem>(), BandC = new List <SelectListItem>(), BandD = new List <SelectListItem>() }; ohmViewModel.BandA = valuesRepository.RetrieveBandValues("A"); ohmViewModel.BandB = valuesRepository.RetrieveBandValues("B"); ohmViewModel.BandC = valuesRepository.RetrieveBandValues("C"); ohmViewModel.BandD = valuesRepository.RetrieveBandValues("D"); }
public ValuesController(ValuesRepository _repository) { repository = _repository; }
public ValuesController(ValuesRepository repository) { _repository = repository; }
public ValuesController(ValuesRepository repository) { this._repository = repository ?? throw new ArgumentNullException(nameof(repository)); }
public ValuesController(ValuesRepository vr) { _vr = vr; }
public ValuesController() { _valuesRepository = new ValuesRepository(); _logger = LogManager.GetLogger(GetType()); }