示例#1
0
        public void GetSegments_WithLimit(SamplePath path)
        {
            // act
            string[] segments = PathUtilities.GetSegments(path.OriginalPath, 3);

            // assert
            Assert.AreEqual(path.SegmentsLimit3, segments);
        }
        public SamplePath antithetic()
        {
            SamplePath ret = new SamplePath(NQuantLibcPINVOKE.GaussianSobolPathGenerator_antithetic(swigCPtr), true);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
示例#3
0
        public SamplePath next()
        {
            SamplePath ret = new SamplePath(NQuantLibcPINVOKE.GaussianPathGenerator_next(swigCPtr), false);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public SamplePath antithetic()
        {
            SamplePath ret = new SamplePath(NQuantLibcPINVOKE.InvCumulativeMersenneTwisterPathGenerator_antithetic(swigCPtr), false);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
示例#5
0
        public void NormalizePath(SamplePath path)
        {
            // act
            string normalized = PathUtilities.NormalizePath(path.OriginalPath);

            // assert
#if SMAPI_FOR_WINDOWS
            Assert.AreEqual(path.NormalizedOnWindows, normalized);
#else
            Assert.AreEqual(path.NormalizedOnUnix, normalized);
#endif
        }
示例#6
0
        public void NormalizeAssetName(SamplePath path)
        {
            if (Path.IsPathRooted(path.OriginalPath) || path.OriginalPath.StartsWith('/') || path.OriginalPath.StartsWith('\\'))
            {
                Assert.Ignore("Absolute paths can't be used as asset names.");
            }

            // act
            string normalized = PathUtilities.NormalizeAssetName(path.OriginalPath);

            // assert
            Assert.AreEqual(path.NormalizedOnUnix, normalized); // MonoGame uses the Linux format
        }
示例#7
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SamplePath obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
 public SamplePath antithetic() {
   SamplePath ret = new SamplePath(NQuantLibcPINVOKE.GaussianSobolPathGenerator_antithetic(swigCPtr), true);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
示例#9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SamplePath obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }