public void GetCollectionExpression_NamedCollection_ReturnsFullExpression(string scopeName, string collectionName) { // Arrange var collectionQueryable = new Mock <ICollectionQueryable>(); collectionQueryable.SetupGet(m => m.BucketName).Returns("default"); collectionQueryable.SetupGet(m => m.ScopeName).Returns(scopeName); collectionQueryable.SetupGet(m => m.CollectionName).Returns(collectionName); // Act var result = N1QlHelpers.GetCollectionExpression(collectionQueryable.Object); // Assert Assert.AreEqual($"`default`.`{scopeName}`.`{collectionName}`", result); }
public void GetCollectionExpression_DefaultCollection_ReturnsJustBucket() { // Arrange var collectionQueryable = new Mock <ICollectionQueryable>(); collectionQueryable.SetupGet(m => m.BucketName).Returns("default"); collectionQueryable.SetupGet(m => m.ScopeName).Returns(N1QlHelpers.DefaultScopeName); collectionQueryable.SetupGet(m => m.CollectionName).Returns(N1QlHelpers.DefaultCollectionName); // Act var result = N1QlHelpers.GetCollectionExpression(collectionQueryable.Object); // Assert Assert.AreEqual("`default`", result); }