public void Test() { //send invite var network = new FakeNetwork(); var cs1 = new FakeSipContextSource(TestConstants.IpEndPoint1); var cs2 = new FakeSipContextSource(TestConstants.IpEndPoint2); //var idleState = new IdleState(null); //var sendCommand = (IdleSendCommand) idleState.ProcessRequest(); //var contextSourceMock = new Mock<ISipContextSource>(); //contextSourceMock.Setup((cs)=> cs.SendTo(It.IsAny<byte[]>(), It.IsAny<IPEndPoint>())).Callback((byte[] bytes, IPEndPoint endPoint) => // { // var sipContext = ConvertToSipContext(bytes); // idleState.ProcessRequest(sipContext); // network.SendTo(); // }) //cs1.AddToNetwork(network); //cs2.AddToNetwork(network); //var sipProvider1 = new SipProvider(new SipStack(), cs1); ////var sipProvider2 = new SipProvider(new SipStack(), cs2); ////sendCommand.Response; //var sipProviderMock = new Mock<ISipProvider>(); //sipProviderMock.Setup((p) => p.ListeningPoint).Returns(new SipListeningPoint(TestConstants.IpEndPoint2)); ////sipProviderMock.Setup((p) => p.CreateServerDialog(It.IsAny<ISipServerTransaction>())).Returns(); //var commandFactoryMock = new Mock<ICommandFactory>(); //bool fired1,fired2,fired3; //SoftPhone calleePhone = new SoftPhone(sipProvider1, new SipMessageFactory(), new SipHeaderFactory(), new SipAddressFactory(), new CommandFactory()); //calleePhone.IncomingCall += CalleePhoneOnIncomingCall; //calleePhone.StateChanged += CalleePhoneOnStateChanged; //calleePhone.Start(); //IPhoneLine calleePhoneLine = calleePhone.CreatePhoneLine(new SipAccount()); //calleePhoneLine.Register(); //SoftPhone callerPhone = new SoftPhone(sipProvider2, new SipMessageFactory(), new SipHeaderFactory(), new SipAddressFactory(), new CommandFactory()); //callerPhone.StateChanged += CallerPhoneOnStateChanged; //callerPhone.Start(); //IPhoneCall phoneCall = callerPhone.CreateCall(); //phoneCall.Invite(TestConstants.IpEndPoint1.ToString()); //callerPhone.State.Should().BeOfType<RingingState>(); //calleePhone.State.Should().BeOfType<RingingState>(); //var softPhone = /*simulate receive invite.*/ /*verify ringingresponse sent*/ /*verify both caller + callee to ringingstate*/ }
public override void Initialize() { SetStartDate(2008, 12, 25); SetEndDate(2020, 5, 1); SetCash(100000); //EnableAutomaticIndicatorWarmUp = true; AddSecurity(SecurityType.Forex, _symbol, Resolution.Hour, Market.IB, false, 1, true); symbol = Symbol(_symbol); SetBenchmark(symbol); _indicator = FN(symbol, window_size, 6, 1, SubscriptionManager, Resolution.Hour); }
protected override void Given() { //create invite that is addresses to the phone's sipuri _invite = CreateInviteRequest(_testClientUaUri, _phoneUaUri); //create phone that is located at IpEndPoint2 var phoneCs = new FakeSipContextSource(_phoneUaEndPoint); _network = new FakeNetwork(); _sipProvider1 = new SipProvider(new SipStack(), phoneCs); _phone = new SoftPhone(_sipProvider1, new SipMessageFactory(), new SipHeaderFactory(), new SipAddressFactory(), _stateProvider, _timerFactory, new SipListeningPoint(_phoneUaEndPoint)); phoneCs.AddToNetwork(_network); _network.AddReceiver(_testClientUaEndPoint, OnTestClientUaReceive); _phone.InternalStateChanged += new EventHandler <EventArgs>(_calleePhone_InternalStateChanged); _phone.IncomingCall += new EventHandler <VoipEventArgs <IPhoneCall> >(_calleePhone_IncomingCall); _phone.Start(); GivenOverride(); }
public Task <LandingDTO> GetAsync([Header(Settings.Settings.ApiAuthorizationHeader)] string authorizationHeader) => FakeNetwork.ReturnAsync(new LandingDTO { PopularProducts = FakeProducts.Fakes, });
public async Task <ProductsPerTypeDTO> GetProductsAsync( [Header("Authorization")] string authorizationHeader, string type) => await FakeNetwork.ReturnAsync(new ProductsPerTypeDTO { Products = FakeProducts.Fakes, });
public async Task <ProductDTO> GetDetailAsync([Header("Authorization")] string authorizationHeader, string id) => await FakeNetwork.ReturnAsync(FakeProducts.Fakes.FirstOrDefault(product => product.Id.ToString() == id));
public async Task <IEnumerable <ProductDTO> > GetSimilarProductsAsync( [Header("Authorization")] string authorizationHeader, [AliasAs("file")] StreamPart stream) => await FakeNetwork.ReturnAsync(FakeProducts.Fakes);
public async Task <ProdutosPorCategoria> GetCategoriasAsync( [Header("Authorization")] string authorizationHeader, string categoria) => await FakeNetwork.ReturnAsync(new ProdutosPorCategoria { Categorias = FakeProducts.Categ, });