public void FastBitmapModificationsAreApplied()
        {
            List <string> files = new List <string>
            {
                ImageSources.GetFilePathByName("format-Penguins.jpg"),
                ImageSources.GetFilePathByName("format-Penguins.png"),
            };

            foreach (string file in files)
            {
                Bitmap bmp      = new Bitmap(file);
                Bitmap original = (Bitmap)bmp.Clone();

                using (FastBitmap fbmp = new FastBitmap(bmp))
                {
                    // draw a pink diagonal line
                    for (int i = 0; i < 10; i++)
                    {
                        fbmp.SetPixel(i, i, Color.Pink);
                    }
                }

                AssertionHelpers.AssertImagesAreDifferent(original, bmp, "because modifying the fast bitmap should have modified the original bitmap");
            }
        }
Exemple #2
0
        public void PdfNullClass_WriteToMethodWithStreamParameter_WritesCorrectValueToParameterWhenParameterIsNotNull()
        {
            PdfNull testObject = PdfNull.Value;

            using MemoryStream testParam = new MemoryStream();

            testObject.WriteTo(testParam);

            using MemoryStream expected = new MemoryStream(Encoding.ASCII.GetBytes("null "));
            AssertionHelpers.AssertSameElements(expected, testParam);
        }
Exemple #3
0
        public void PdfNullClass_WriteToMethodWithListParameter_WritesCorrectValueToParameterWhenParameterIsNotNull()
        {
            PdfNull     testObject = PdfNull.Value;
            List <byte> testParam  = new List <byte>();

            testObject.WriteTo(testParam);

            List <byte> expected = Encoding.ASCII.GetBytes("null ").ToList();

            AssertionHelpers.AssertSameElements(expected, testParam);
        }
Exemple #4
0
        public void PdfIntegerClass_WriteToMethodWithListParameter_WritesCorrectValueToList()
        {
            int         testObjectValue = _rnd.Next(int.MinValue, int.MaxValue);
            PdfInteger  testObject      = new PdfInteger(testObjectValue);
            List <byte> testParam0      = new List <byte>();

            testObject.WriteTo(testParam0);

            List <byte> expected = Encoding.ASCII.GetBytes(testObjectValue.ToString("d", CultureInfo.InvariantCulture) + " ").ToList();

            AssertionHelpers.AssertSameElements(expected, testParam0);
        }
Exemple #5
0
        public void PdfIntegerClass_WriteToMethodWithStreamParameter_WritesCorrectValueToList()
        {
            int        testObjectValue = _rnd.Next(int.MinValue, int.MaxValue);
            PdfInteger testObject      = new PdfInteger(testObjectValue);

            using (MemoryStream testParam0 = new MemoryStream())
            {
                testObject.WriteTo(testParam0);

                using (MemoryStream expected = new MemoryStream(Encoding.ASCII.GetBytes(testObjectValue.ToString("d", CultureInfo.InvariantCulture) + " ")))
                {
                    AssertionHelpers.AssertSameElements(expected, testParam0);
                }
            }
        }
        public void FastBitmapModificationsAreApplied(string file)
        {
            Bitmap bmp      = new Bitmap(file);
            Bitmap original = (Bitmap)bmp.Clone();

            using (FastBitmap fbmp = new FastBitmap(bmp))
            {
                // draw a pink diagonal line
                for (int i = 0; i < 10; i++)
                {
                    fbmp.SetPixel(i, i, Color.Pink);
                }
            }

            AssertionHelpers.AssertImagesAreDifferent(original, bmp, "because modifying the fast bitmap should have modified the original bitmap");
        }
Exemple #7
0
 /// <summary>
 /// Assert the submission succeeded within a normal timespan.
 /// </summary>
 protected override void OnAssertSubmissionSucceeded()
 {
     AssertionHelpers.AssertElementIsVisibleByXPath(string.Format(Constants.HeaderWithTextXPath,
                                                                  "The addition was successful!"), TimeSpanHelpers.NormalWait);
 }
Exemple #8
0
 /// <summary>
 /// Assert the submission failed within a normal timespan.
 /// </summary>
 protected override void OnAssertSubmissionFailed()
 {
     AssertionHelpers.AssertElementIsVisibleByClass("validation-summary-errors", TimeSpanHelpers.NormalWait);
 }
Exemple #9
0
 /// <summary>
 /// Assert the add pokemon form is showing within a normal timespan.
 /// </summary>
 protected override void OnAssertIsLoaded()
 {
     AssertionHelpers.AssertElementIsVisibleByClass("form__container", TimeSpanHelpers.NormalWait);
 }
Exemple #10
0
 public RegisterSteps(Settings Settings, CommonSteps Step, AssertionHelpers AssertionHelpers)
 {
     this._Settings         = Settings;
     this._Step             = Step;
     this._AssertionHelpers = AssertionHelpers;
 }
Exemple #11
0
 /// <summary>
 /// Assert you are at the login page within a normal timespan.
 /// </summary>
 public static void AssertIsAt()
 {
     AssertionHelpers.AssertIsAtPage(Constants.Login, TimeSpanHelpers.NormalWait);
 }
Exemple #12
0
 /// <summary>
 /// Assert the submission succeeded within a normal timespan.
 /// </summary>
 protected override void OnAssertSubmissionSucceeded()
 {
     AssertionHelpers.AssertElementIsVisibleByCssSelector(".avatarName", TimeSpanHelpers.NormalWait);
 }
Exemple #13
0
 /// <summary>
 /// Assert the release of the pokemon from the mypokedex page succeeds within a normal timespan.
 /// </summary>
 public static void AssertReleaseIsSuccessful()
 {
     AssertionHelpers.AssertElementIsVisibleByXPath(string.Format(Constants.HeaderWithTextXPath,
                                                                  "The release was successful!"), TimeSpanHelpers.NormalWait);
 }
Exemple #14
0
 /// <summary>
 /// Assert you are at the mypokedex page within a normal timespan.
 /// </summary>
 public static void AssertIsAt()
 {
     AssertionHelpers.AssertIsAtPage(MyPokedex, TimeSpanHelpers.NormalWait);
 }
Exemple #15
0
 /// <summary>
 /// Assert the member login form is showing within a normal timespan.
 /// </summary>
 protected override void OnAssertIsLoaded()
 {
     AssertionHelpers.AssertElementIsVisibleByCssSelector("#memberloginForm", TimeSpanHelpers.NormalWait);
 }
Exemple #16
0
 /// <summary>
 /// Assert the login submission failed within a normal timespan.
 /// </summary>
 protected override void OnAssertSubmissionFailed()
 {
     AssertionHelpers.AssertIsAtPage("Bad " + Constants.Login, TimeSpanHelpers.NormalWait);
 }
Exemple #17
0
 /// <summary>
 /// Assert you are at the add pokemon page within a normal timespan.
 /// </summary>
 public static void AssertIsAt()
 {
     AssertionHelpers.AssertIsAtPage(AddPokemon, TimeSpanHelpers.NormalWait);
 }
 protected void ValidateTrainingData(List <ISample> trainingSamples)
 {
     // check all dimensions are equal
     AssertionHelpers.WithEqualNumberOfDimensions(trainingSamples);
 }
 public ProductListSteps(Settings Settings, CommonSteps CommonStep, AssertionHelpers AssertionHelpers)
 {
     this._Settings         = Settings;
     this._CommonStep       = CommonStep;
     this._AssertionHelpers = AssertionHelpers;
 }
Exemple #20
0
 /// <summary>
 /// Assert the logout succeeded within a normal timespan.
 /// </summary>
 public static void AssertLogoutSucceeded()
 {
     AssertionHelpers.AssertElementIsVisibleByCssSelector(".loginheader", TimeSpanHelpers.NormalWait);
 }
 public CommonSteps(Settings Settings, TableExtensions TableExtension, AssertionHelpers AssertionHelpers)
 {
     this._Settings         = Settings;
     this._TableExtension   = TableExtension;
     this._AssertionHelpers = AssertionHelpers;
 }