Skip to content

Commit

Permalink
Merge pull request #673 from ShapeCrawler/next
Browse files Browse the repository at this point in the history
Refactor test
  • Loading branch information
ashahabov committed May 10, 2024
2 parents f2f4f79 + 9dcfe3f commit 4720f35
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Version 0.50.4 - 2024-05-10
🐞Fixed `ISlideShapes.AddPicture()` [#671](https://github.com/ShapeCrawler/ShapeCrawler/issues/671)

## Version 0.50.3 - 2024-03-06
🐞Fixed `IShape.AsTable()`

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Pull Requests are welcome! Please read the [Contribution Guide](https://github.c

## Changelog

### Version 0.50.3 - 2024-03-06
🐞Fixed `IShape.AsTable()`
### Version 0.50.4 - 2024-05-10
🐞Fixed `ISlideShapes.AddPicture()` [#671](https://github.com/ShapeCrawler/ShapeCrawler/issues/671)

Visit [CHANGELOG.md](https://github.com/ShapeCrawler/ShapeCrawler/blob/master/CHANGELOG.md) to see the full log.
2 changes: 1 addition & 1 deletion src/ShapeCrawler/ShapeCrawler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This library provides a simplified object model on top of the Open XML SDK for m
<PackageTags>ShapeCrawler Presentation PPTX PowerPoint Slides OpenXml OOXML</PackageTags>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<PackageReleaseNotes>Fixed IShape.AsTable()</PackageReleaseNotes>
<PackageReleaseNotes>Fixed ISlideShapes.AddPicture()</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/ShapeCrawler/ShapeCrawler</PackageProjectUrl>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<RepositoryType>Git</RepositoryType>
Expand Down
10 changes: 1 addition & 9 deletions test/ShapeCrawler.Tests.Unit.xUnit/Helpers/TestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ static TestHelper()
HorizontalResolution = 96;
VerticalResolution = 96;
}

public static MemoryStream ToResizeableStream(this byte[] byteArray)
{
var stream = new MemoryStream();
stream.Write(byteArray, 0, byteArray.Length);

return stream;
}


public static MemoryStream GetStream(string fileName)
{
var assembly = Assembly.GetExecutingAssembly();
Expand Down
10 changes: 4 additions & 6 deletions test/ShapeCrawler.Tests.Unit/ShapeCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ public void AddPicture_adds_picture()
picture.ShapeType.Should().Be(ShapeType.Picture);
pres.Validate();
}

[Test]
public void AddPicture_sets_dimensions()
public void AddPicture_adds_picture_with_correct_Height()
{
// Arrange
var pres = new Presentation();
Expand All @@ -378,12 +378,10 @@ public void AddPicture_sets_dimensions()
shapes.AddPicture(image);

// Assert
var picture = (IPicture)shapes.Last();
picture.Width.Should().Be(300);
picture.Height.Should().Be(300);
var addedPicture = shapes.Last();
addedPicture.Height.Should().Be(300);
}


[Test]
public void AddRectangle_adds_rectangle_with_valid_id_and_name()
{
Expand Down

0 comments on commit 4720f35

Please sign in to comment.