Пример #1
0
 public bool Equals(FormulationTypeDTO other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.Id, Id));
 }
        protected override void Context()
        {
            base.Context();
            _formulationTypeDTO = new FormulationTypeDTO {
                Id = "trala"
            };
            _formulation    = A.Fake <Formulation>();
            _formulationDTO = new FormulationDTO {
                Type = _formulationTypeDTO
            };

            A.CallTo(() => _formulationDTOMapper.MapFrom(_formulation)).Returns(_formulationDTO);
            sut.EditFormulation(_formulation);
            sut.FormulationTypeChanged += e =>
            {
                _eventRaised = true;
                _valueRaised = e;
            };
            var templateFormulation = A.Fake <Formulation>();

            A.CallTo(() => _cloner.Clone(templateFormulation)).Returns(_formulation);
            A.CallTo(() => _formulationRepository.FormulationBy(_formulationTypeDTO.Id)).Returns(templateFormulation);
        }