public void StorageReturnNull_ReturnFail()
        {
            var storageMock = new Mock <ProxyFigureStorage>();

            storageMock
            .Setup(x => x.GetDescriptionType(It.IsAny <string>()))
            .Returns((Type)null);

            var provider = new ProxyFigureDescriptionProvider(storageMock.Object);

            Result <Type> result = provider.GetDescriptionType("");

            Assert.AreEqual(result.Fail, true);
        }
        public void StorageReturnNotNull_ReturnSuccess()
        {
            var storageMock = new Mock <ProxyFigureStorage>();

            storageMock
            .Setup(x => x.GetDescriptionType(It.IsAny <string>()))
            .Returns(typeof(CircleDescription));

            var provider = new ProxyFigureDescriptionProvider(storageMock.Object);

            Result <Type> result = provider.GetDescriptionType("");

            Assert.AreEqual(result.Success, true);
        }
 public CalcAreaHandler(IQueryFactory queryFactory, ProxyFigureCalculator figureCalculator, ProxyFigureDescriptionProvider descriptionProvider)
 {
     _queryFactory        = queryFactory;
     _figureCalculator    = figureCalculator;
     _descriptionProvider = descriptionProvider;
 }
Beispiel #4
0
 public CalcAreaHandlerTests()
 {
     _validator           = new ProxyFigureValidator(_storage);
     _calculator          = new ProxyFigureCalculator(_storage, _validator);
     _descriptionProvider = new ProxyFigureDescriptionProvider(_storage);
 }
Beispiel #5
0
 public AddFigureRequestModelBinder(ProxyFigureDescriptionProvider descriptionProvider)
 {
     _descriptionProvider = descriptionProvider;
 }