Fixes merge issues... but now have to fix all the unit tests
This commit is contained in:
@@ -20,18 +20,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
|
||||
}
|
||||
}
|
||||
|
||||
//[Migration("7.0.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
//public class RemoveDefaultPermissionUserColumn : MigrationBase
|
||||
//{
|
||||
// public override void Up()
|
||||
// {
|
||||
// Alter.Table("").AlterColumn()
|
||||
// }
|
||||
|
||||
// public override void Down()
|
||||
// {
|
||||
// throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
public class RemoveDefaultPermissionUserColumn : MigrationBase
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
Delete.Column("userDefaultPermissions").FromTable("umbracoUser");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
throw new NotSupportedException("Cannot downgrade from a version 7 database to a prior version");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,12 @@ namespace Umbraco.Core.Persistence
|
||||
|
||||
}
|
||||
|
||||
internal RepositoryFactory(bool disableAllCache)
|
||||
: this(disableAllCache, UmbracoConfiguration.Current.UmbracoSettings)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal RepositoryFactory(bool disableAllCache, IUmbracoSettingsSection settings)
|
||||
{
|
||||
_disableAllCache = disableAllCache;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
@@ -16,16 +16,18 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Does_Not_Throw_Exception_When_Access_Allowed_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = -1;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var content = new Mock<IContent>().Object;
|
||||
content.Path = "-1,1234,5678";
|
||||
var contentService = MockRepository.GenerateStub<IContentService>();
|
||||
contentService.Stub(x => x.GetById(1234)).Return(content);
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userService.Stub(x => x.GetPermissions(user, 1234)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, 'F');
|
||||
@@ -38,16 +40,18 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Throws_Exception_When_No_Content_Found()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = -1;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var content = new Mock<IContent>().Object;
|
||||
content.Path = "-1,1234,5678";
|
||||
var contentService = MockRepository.GenerateStub<IContentService>();
|
||||
contentService.Stub(x => x.GetById(0)).Return(content);
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(0)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userService.Stub(x => x.GetPermissions(user, 1234)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act/assert
|
||||
Assert.Throws<HttpResponseException>(() => ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, 'F'));
|
||||
@@ -57,16 +61,18 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Throws_Exception_When_No_Access_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = 9876;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var content = new Mock<IContent>().Object;
|
||||
content.Path = "-1,1234,5678";
|
||||
var contentService = MockRepository.GenerateStub<IContentService>();
|
||||
contentService.Stub(x => x.GetById(1234)).Return(content);
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userService.Stub(x => x.GetPermissions(user, 1234)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, 'F');
|
||||
@@ -79,19 +85,21 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Throws_Exception_When_No_Access_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = -1;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var content = new Mock<IContent>().Object;
|
||||
content.Path = "-1,1234,5678";
|
||||
var contentService = MockRepository.GenerateStub<IContentService>();
|
||||
contentService.Stub(x => x.GetById(1234)).Return(content);
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A", "B", "C" })
|
||||
};
|
||||
userService.Stub(x => x.GetPermissions(user, 1234)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, 'F');
|
||||
@@ -104,19 +112,21 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Does_Not_Throw_Exception_When_Access_Allowed_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = -1;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var content = new Mock<IContent>().Object;
|
||||
content.Path = "-1,1234,5678";
|
||||
var contentService = MockRepository.GenerateStub<IContentService>();
|
||||
contentService.Stub(x => x.GetById(1234)).Return(content);
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A", "F", "C" })
|
||||
};
|
||||
userService.Stub(x => x.GetPermissions(user, 1234)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, 'F');
|
||||
@@ -129,16 +139,18 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Does_Not_Throw_Exception_When_No_Permissions_Assigned()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = -1;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var content = new Mock<IContent>().Object;
|
||||
content.Path = "-1,1234,5678";
|
||||
var contentService = MockRepository.GenerateStub<IContentService>();
|
||||
contentService.Stub(x => x.GetById(1234)).Return(content);
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userService.Stub(x => x.GetPermissions(user, 1234)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, 'F');
|
||||
|
||||
@@ -3,8 +3,8 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Net.Http.Headers;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
@@ -79,8 +79,8 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
}
|
||||
path += i.ToInvariantString();
|
||||
list.Add(new ContentItemBasic { Id = i, Name = "Test" + i, ParentId = i, Path = path });
|
||||
}
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
}
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = 5;
|
||||
|
||||
@@ -100,10 +100,10 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
list.Add(new ContentItemBasic{Id = i, Name = "Test" + i, ParentId = -1});
|
||||
}
|
||||
var ids = list.Select(x => (int)x.Id).ToArray();
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var user = new Mock<IUser>().Object;
|
||||
user.Id = 9;
|
||||
user.StartContentId = -1;
|
||||
var userService = MockRepository.GenerateStub<IUserService>();
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
//we're only assigning 3 nodes browse permissions so that is what we expect as a result
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
@@ -112,7 +112,8 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
new EntityPermission(9, 3, new string[]{ "F" }),
|
||||
new EntityPermission(9, 4, new string[]{ "A" })
|
||||
};
|
||||
userService.Stub(x => x.GetPermissions(user, ids)).Return(permissions);
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, ids)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
att.FilterBasedOnPermissions(list, user, userService);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
@@ -16,14 +16,17 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Does_Not_Throw_Exception_When_Access_Allowed_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var userMock = new Mock<IUser>();
|
||||
var user = userMock.Object;
|
||||
user.Id = 9;
|
||||
user.StartMediaId = -1;
|
||||
var media = MockRepository.GenerateStub<IMedia>();
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
var media = mediaMock.Object;
|
||||
media.Path = "-1,1234,5678";
|
||||
var mediaService = MockRepository.GenerateStub<IMediaService>();
|
||||
mediaService.Stub(x => x.GetById(1234)).Return(media);
|
||||
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
|
||||
|
||||
@@ -35,13 +38,16 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Throws_Exception_When_No_Media_Found()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var userMock = new Mock<IUser>();
|
||||
var user = userMock.Object;
|
||||
user.Id = 9;
|
||||
user.StartMediaId = -1;
|
||||
var media = MockRepository.GenerateStub<IMedia>();
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
var media = mediaMock.Object;
|
||||
media.Path = "-1,1234,5678";
|
||||
var mediaService = MockRepository.GenerateStub<IMediaService>();
|
||||
mediaService.Stub(x => x.GetById(0)).Return(media);
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(0)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act/assert
|
||||
Assert.Throws<HttpResponseException>(() => MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234));
|
||||
@@ -51,13 +57,16 @@ namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
public void Throws_Exception_When_No_Access_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var userMock = new Mock<IUser>();
|
||||
var user = userMock.Object;
|
||||
user.Id = 9;
|
||||
user.StartMediaId = 9876;
|
||||
var media = MockRepository.GenerateStub<IMedia>();
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
var media = mediaMock.Object;
|
||||
media.Path = "-1,1234,5678";
|
||||
var mediaService = MockRepository.GenerateStub<IMediaService>();
|
||||
mediaService.Stub(x => x.GetById(1234)).Return(media);
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(0)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
|
||||
@@ -16,9 +16,11 @@ namespace Umbraco.Tests.Models
|
||||
[TestCase(1, "-1,-20,1,2,3,4,5", false)]
|
||||
public void Determines_Path_Based_Access_To_Content(int userId, string contentPath, bool outcome)
|
||||
{
|
||||
var user = MockRepository.GenerateStub<IUser>();
|
||||
var userMock = new Mock<IUser>();
|
||||
var user = userMock.Object;
|
||||
user.StartContentId = userId;
|
||||
var content = MockRepository.GenerateStub<IContent>();
|
||||
var contentMock = new Mock<IContent>();
|
||||
var content = contentMock.Object;
|
||||
content.Path = contentPath;
|
||||
|
||||
Assert.AreEqual(outcome, user.HasPathAccess(content));
|
||||
|
||||
@@ -482,6 +482,7 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
var names = users.Select(x => x.Username).ToArray();
|
||||
Assert.IsTrue(names.Contains("TestUser1"));
|
||||
Assert.IsTrue(names.Contains("TestUser3"));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -500,7 +501,7 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual("ABC", user1.DefaultPermissions);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void AssertPropertyValues(IUser updatedItem, IUser originalUser)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
@@ -21,7 +21,8 @@ namespace Umbraco.Tests.PropertyEditors
|
||||
[Test]
|
||||
public void DropDownMultipleValueEditor_With_Keys_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeService = MockRepository.GenerateStub<IDataTypeService>();
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValuesMultipleValueEditor(true, dataTypeService, new ValueEditor());
|
||||
|
||||
var result = editor.FormatValueForCache(
|
||||
@@ -35,15 +36,18 @@ namespace Umbraco.Tests.PropertyEditors
|
||||
[Test]
|
||||
public void DropDownMultipleValueEditor_No_Keys_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeService = MockRepository.GenerateStub<IDataTypeService>();
|
||||
dataTypeService
|
||||
.Stub(x => x.GetPreValuesCollectionByDataTypeId(Arg<int>.Is.Anything))
|
||||
.Return(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
|
||||
dataTypeServiceMock
|
||||
.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>()))
|
||||
.Returns(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"key0", new PreValue(4567, "Value 1")},
|
||||
{"key1", new PreValue(1234, "Value 2")},
|
||||
{"key2", new PreValue(8910, "Value 3")}
|
||||
}));
|
||||
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValuesMultipleValueEditor(false, dataTypeService, new ValueEditor());
|
||||
|
||||
var result = editor.FormatValueForCache(
|
||||
@@ -57,15 +61,17 @@ namespace Umbraco.Tests.PropertyEditors
|
||||
[Test]
|
||||
public void DropDownValueEditor_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeService = MockRepository.GenerateStub<IDataTypeService>();
|
||||
dataTypeService
|
||||
.Stub(x => x.GetPreValuesCollectionByDataTypeId(Arg<int>.Is.Anything))
|
||||
.Return(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
dataTypeServiceMock
|
||||
.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>()))
|
||||
.Returns(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"key0", new PreValue(10, "Value 1")},
|
||||
{"key1", new PreValue(1234, "Value 2")},
|
||||
{"key2", new PreValue(11, "Value 3")}
|
||||
}));
|
||||
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValueValueEditor(dataTypeService, new ValueEditor());
|
||||
|
||||
var result = editor.FormatValueForCache(
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
serverMock.Setup(x => x.MapPath(It.IsAny<string>())).Returns(Environment.CurrentDirectory);
|
||||
|
||||
//User
|
||||
var user = MockRepository.GenerateStub<IPrincipal>();
|
||||
var user = new Mock<IPrincipal>().Object;
|
||||
|
||||
//HTTP Context
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
httpContextMock.Setup(x => x.Request).Returns(requestMock.Object);
|
||||
httpContextMock.Setup(x => x.Server).Returns(serverMock.Object);
|
||||
httpContextMock.Setup(x => x.Response).Returns(responseMock.Object);
|
||||
HttpContext.Stub(x => x.User).Return(user);
|
||||
httpContextMock.Setup(x => x.User).Returns(user);
|
||||
|
||||
HttpContext = httpContextMock.Object;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user