Exemplo n.º 1
0
        public void SetUp()
        {
            // Do I want to mock this to not make a web client call?
            IPreciousMetalsPriceApi api = new PreciousMetalsPriceApi();

            ServiceLocator.AddItem(typeof(IPreciousMetalsPriceApi), api);

            _api = ServiceLocator.GetInstance <IPreciousMetalsPriceApi>();
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            var dataAccessMock = new Mock <IDataAccess>();

            dataAccessMock.Setup(x => x.GetNextRunId()).Returns(0);
            dataAccessMock.Setup(x => x.GetList <PreciousMetalsHistory>())
            .Returns(new List <PreciousMetalsHistory>());

            ServiceLocator.AddItem(dataAccessMock.Object);

            // Should I mock this so I don't make a web client call?
            IPreciousMetalsPriceApi preciousMetalsPriceApi = new PreciousMetalsPriceApi();

            ServiceLocator.AddItem(typeof(IPreciousMetalsPriceApi), preciousMetalsPriceApi);
        }
        public static void ConfigureStructureMap()
        {
            IDataAccess dataAccess = new DataAccess();

            ServiceLocator.AddItem(typeof(IDataAccess), dataAccess);

            IEntitySync entitySync = new EntitySync();

            ServiceLocator.AddItem(typeof(IEntitySync), entitySync);

            IPreciousMetalsPriceApi preciousMetalsPriceApi = new PreciousMetalsPriceApi();

            ServiceLocator.AddItem(typeof(IPreciousMetalsPriceApi), preciousMetalsPriceApi);

            IAccountInfoHandler accountInfoHandler = new AccountInfoHandler();

            ServiceLocator.AddItem(typeof(IAccountInfoHandler), accountInfoHandler);

            IMintApi mintApi = new MintApi();

            ServiceLocator.AddItem(typeof(IMintApi), mintApi);
        }