Example #1
0
    public void Sends_Message_And_Args_To_Verbose_Log()
    {
        // Arrange
        var(_, log, entity) = Repository_Setup.Get();
        var message = Rnd.Str;
        var args    = new object[] { Rnd.Int, Rnd.Int };

        // Act
        entity.WriteToLogTest(message, args);

        // Assert
        log.Received().Vrb(message, args);
    }
Example #2
0
    public async Task Logs_Query_To_Verbose()
    {
        // Arrange
        var(_, log, repo) = Repository_Setup.Get();
        var foo = new Repository_Setup.Foo {
            Id = LongId <Repository_Setup.FooId>()
        };

        // Act
        await repo.CreateAsync(foo);

        // Assert
        log.ReceivedWithAnyArgs().Vrb(Arg.Any <string>(), Arg.Any <object[]>());
    }
Example #3
0
    public async Task Calls_Client_GetCreateQuery()
    {
        // Arrange
        var(client, _, repo) = Repository_Setup.Get();
        var foo = new Repository_Setup.Foo {
            Id = LongId <Repository_Setup.FooId>()
        };

        // Act
        await repo.CreateAsync(foo);

        // Assert
        client.Received().GetCreateQuery <Repository_Setup.Foo>();
    }
Example #4
0
    public async Task Calls_Client_GetRetrieveQuery()
    {
        // Arrange
        var(client, _, repo) = Repository_Setup.Get();
        var value = Rnd.Lng;

        // Act
        await repo.RetrieveAsync <Repository_Setup.FooModel>(new Repository_Setup.FooId {
            Value = value
        });

        // Assert
        client.Received().GetRetrieveQuery <Repository_Setup.Foo, Repository_Setup.FooModel>(value);
    }
Example #5
0
    public async Task Logs_Query_To_Verbose()
    {
        // Arrange
        var(_, log, repo) = Repository_Setup.Get();
        var value = Rnd.Lng;

        // Act
        await repo.RetrieveAsync <Repository_Setup.FooModel>(new Repository_Setup.FooId {
            Value = value
        });

        // Assert
        log.ReceivedWithAnyArgs().Vrb(Arg.Any <string>(), Arg.Any <object[]>());
    }
Example #6
0
    public async Task Calls_Client_GetUpdateQuery()
    {
        // Arrange
        var(client, _, repo) = Repository_Setup.Get();
        var value = Rnd.Lng;
        var model = new Repository_Setup.FooModel {
            Id = new() { Value = value }
        };

        // Act
        await repo.UpdateAsync(model);

        // Assert
        client.Received().GetUpdateQuery <Repository_Setup.Foo, Repository_Setup.FooModel>(value);
    }
Example #7
0
    public async Task Logs_Query_To_Verbose()
    {
        // Arrange
        var(_, log, repo) = Repository_Setup.Get();
        var value = Rnd.Lng;
        var model = new Repository_Setup.FooModel {
            Id = new() { Value = value }
        };

        // Act
        await repo.UpdateAsync(model);

        // Assert
        log.ReceivedWithAnyArgs().Vrb(Arg.Any <string>(), Arg.Any <object[]>());
    }
}