Skip to content

Commit 07f4030

Browse files
committed
Change tracker is now clean before test execution in 3.1 (#397)
1 parent 859ee57 commit 07f4030

File tree

38 files changed

+91
-63
lines changed

38 files changed

+91
-63
lines changed

plugins/MyTested.AspNetCore.Mvc.NewtonsoftJson/MyTested.AspNetCore.Mvc.NewtonsoftJson.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC Newtonsoft JSON components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.NewtonsoftJson</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

plugins/MyTested.AspNetCore.Mvc.Versioning/MyTested.AspNetCore.Mvc.Versioning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC versioning components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Versioning</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

samples/MusicStore/MusicStore.Test/Controllers/ShoppingCartControllerTest.cs

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,10 @@ public void IndexShouldReturnCartItemsWhenItemsInCart()
5252
MyMvc
5353
.Controller<ShoppingCartController>()
5454
.WithSession(session => session.WithEntry("Session", cartId))
55-
.WithData(db => db
56-
.WithEntities(entities =>
57-
{
58-
var cartItems = CreateTestCartItems(
59-
cartId,
60-
itemPrice: 10,
61-
numberOfItem: 5);
62-
63-
entities.AddRange(cartItems.Select(n => n.Album).Distinct());
64-
entities.AddRange(cartItems);
65-
}))
55+
.WithData(CreateTestCartItems(
56+
cartId,
57+
itemPrice: 10,
58+
numberOfItem: 5))
6659
.Calling(c => c.Index())
6760
.ShouldReturn()
6861
.View(view => view
@@ -82,9 +75,7 @@ public void AddToCartShouldAddItemsToCart()
8275
MyMvc
8376
.Controller<ShoppingCartController>()
8477
.WithSession(session => session.WithEntry("Session", "CartId_A"))
85-
.WithData(db => db
86-
.WithEntities(entities => entities
87-
.AddRange(CreateTestAlbums(itemPrice: 10))))
78+
.WithData(CreateTestAlbums(itemPrice: 10))
8879
.Calling(c => c.AddToCart(albumId, CancellationToken.None))
8980
.ShouldReturn()
9081
.Redirect(redirect => redirect
@@ -109,13 +100,7 @@ public void RemoveFromCartShouldRemoveItemFromCart()
109100
MyMvc
110101
.Controller<ShoppingCartController>()
111102
.WithSession(session => session.WithEntry("Session", cartId))
112-
.WithData(db => db
113-
.WithEntities(entities =>
114-
{
115-
var cartItems = CreateTestCartItems(cartId, unitPrice, numberOfItem);
116-
entities.AddRange(cartItems.Select(n => n.Album).Distinct());
117-
entities.AddRange(cartItems);
118-
}))
103+
.WithData(CreateTestCartItems(cartId, unitPrice, numberOfItem))
119104
.Calling(c => c.RemoveFromCart(cartItemId, CancellationToken.None))
120105
.ShouldReturn()
121106
.Json(json => json
@@ -145,13 +130,7 @@ public void RemoveFromCartShouldReturnNoItemsWhenWrongCartIdIsPassed()
145130
MyMvc
146131
.Controller<ShoppingCartController>()
147132
.WithSession(session => session.WithEntry("Session", cartId))
148-
.WithData(db => db
149-
.WithEntities(entities =>
150-
{
151-
var cartItems = CreateTestCartItems(cartId, unitPrice, numberOfItem);
152-
entities.AddRange(cartItems.Select(n => n.Album).Distinct());
153-
entities.AddRange(cartItems);
154-
}))
133+
.WithData(CreateTestCartItems(cartId, unitPrice, numberOfItem))
155134
.Calling(c => c.RemoveFromCart(wrongCartItemId, CancellationToken.None))
156135
.ShouldReturn()
157136
.Json(json => json

samples/MusicStore/MusicStore.Test/Controllers/StoreManagerControllerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public void RemoveAlbumGetShouldReturnViewWithAlbum()
177177
.Passing(model =>
178178
{
179179
Assert.NotNull(model);
180-
Assert.Equal(album, model);
180+
Assert.Equal(album.AlbumId, model.AlbumId);
181181
}));
182182
}
183183

@@ -304,7 +304,7 @@ public void EditShouldReturnDefaultViewWithAlbum()
304304
.Passing(model =>
305305
{
306306
Assert.NotNull(model);
307-
Assert.Equal(album, model);
307+
Assert.Equal(album.AlbumId, model.AlbumId);
308308
}));
309309
}
310310

src/MyTested.AspNetCore.Mvc.Abstractions/MyTested.AspNetCore.Mvc.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC common abstractions and interfaces.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Abstractions</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

src/MyTested.AspNetCore.Mvc.Authentication/MyTested.AspNetCore.Mvc.Authentication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC authentication components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Authentication</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

src/MyTested.AspNetCore.Mvc.Caching/MyTested.AspNetCore.Mvc.Caching.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC caching components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Caching</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

src/MyTested.AspNetCore.Mvc.Configuration/MyTested.AspNetCore.Mvc.Configuration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC configuration components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Configuration</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

src/MyTested.AspNetCore.Mvc.Controllers.ActionResults/MyTested.AspNetCore.Mvc.Controllers.ActionResults.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC controller action result components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Controllers.ActionResults</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

src/MyTested.AspNetCore.Mvc.Controllers.Attributes/MyTested.AspNetCore.Mvc.Controllers.Attributes.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>My Tested ASP.NET Core MVC controller attribute components.</Description>
55
<Copyright>2015-2019 Ivaylo Kenov</Copyright>
66
<AssemblyTitle>MyTested.AspNetCore.Mvc.Controllers.Attributes</AssemblyTitle>
7-
<VersionPrefix>3.1.2</VersionPrefix>
7+
<VersionPrefix>3.1.3</VersionPrefix>
88
<Authors>Ivaylo Kenov</Authors>
99
<TargetFramework>netcoreapp3.1</TargetFramework>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>

0 commit comments

Comments
 (0)