Beispiel #1
0
    public void Update_WhenNameNotChanged_NotInvokeSpaceValidatorService()
    {
        var options = new SpaceOptions();

        var space = SpaceTestHelper.CreateSpace(options);

        space.Update(_mockSpaceChecker.Object, options.Name, "background", Visibility.Private);

        _mockSpaceChecker.Verify(s => s.IsUniqueNameInUserSpace(_userId, It.IsAny <string>()), Times.Never);
    }
Beispiel #2
0
    public static Space CreateSpace(SpaceOptions options)
    {
        var mockSpaceChecker = new Mock <ISpaceChecker>();

        mockSpaceChecker.Setup(s => s.IsUniqueNameInUserSpace(It.IsAny <Guid>(), It.IsAny <string>()))
        .Returns(true);

        return(Space.Initialize(mockSpaceChecker.Object,
                                options.UserId ?? Guid.NewGuid(),
                                options.Name,
                                options.BackgroundImage,
                                options.Visibility));
    }