Alx.Web.Tests.ScreenshotTests.GivenDefault_SaveScreenshot_ShouldReturnImageWithCorrectSize C# (CSharp) 메소드

GivenDefault_SaveScreenshot_ShouldReturnImageWithCorrectSize() 개인적인 메소드

        public void GivenDefault_SaveScreenshot_ShouldReturnImageWithCorrectSize()
        {
            // Arrange
            const string url = "https://www.google.co.uk";
            const string path = @"C:\Temp\screenshot_Desktop.png";
            var format = ImageFormat.Png;

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            // Act
            Screenshot.Save(url, path, format);

            // Assert
            Assert.IsTrue(File.Exists(path));
            var image = Image.FromFile(path);
            Assert.IsNotNull(image);
            Assert.AreEqual(1920, image.Width);
            Assert.AreEqual(1080, image.Height);
        }