Hi,
I'm testing a class which has a method that uses a DevExpress.XPCollection.
Since the collection is created inside the method, I mocked it using
XPCollection<OfertaActiva> xpCol = Isolate.Fake.Instance<XPCollection<OfertaActiva>>(Members.CallOriginal);
Isolate.Swap<XPCollection<OfertaActiva>>().With(xpCol);
But just after the creation of the collection there is a foreach iteration, and there begins my nightmare. It seems to me that I successfully mocked the collection, but once it tries to iterate the collection it throws an exception.
DevExpress.Xpo.XPBaseCollection.BeginLoad()
DevExpress.Xpo.XPBaseCollection.Load()
DevExpress.Xpo.XPBaseCollection.get_Objects()
DevExpress.Xpo.XPBaseCollection.System.Collections.IEnumerable.GetEnumerator()
d__0.MoveNext()
GestionNet.Singleton.GestorPrecioVenta.ObtenerPrecioConOfertas(Boolean isCongelada, Boolean isReabierta, Cliente cliente, Articulo articulo, Double unidadesCaja, DateTime fecha, Double cantidad, Boolean isCajas, Int32& tipoPrecioAplicado, Decimal& precio, Double& pcDescuento)
I added items to xpCol (the faked collection) using
xpCol.Add(obj).
Any hint?
Thanks in advance.