Skip to content

Commit

Permalink
fix(formula): create StringValueObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Dushusir committed Mar 15, 2024
1 parent 01fd1e7 commit 37acb36
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,43 @@ describe('Test or function', () => {

describe('Or', () => {
it('logical1 string', () => {
const logical1 = new StringValueObject('a1');
const logical1 = StringValueObject.create('a1');
const result = textFunction.calculate(logical1);
expect(result.getValue()).toBe(ErrorType.VALUE);
});
it('logical1 number 1', () => {
const logical1 = new NumberValueObject(1);
const logical1 = NumberValueObject.create(1);
const result = textFunction.calculate(logical1);
expect(result.getValue()).toBe(true);
});

it('logical1 number 0', () => {
const logical1 = new NumberValueObject(0);
const logical1 = NumberValueObject.create(0);
const result = textFunction.calculate(logical1);
expect(result.getValue()).toBe(false);
});

it('logical1 null', () => {
const logical1 = new NullValueObject(0);
const logical1 = NullValueObject.create();
const result = textFunction.calculate(logical1);
expect(result.getValue()).toBe(ErrorType.VALUE);
});

it('logical1 true', () => {
const logical1 = new BooleanValueObject(true);
const logical1 = BooleanValueObject.create(true);
const result = textFunction.calculate(logical1);
expect(result.getValue()).toBe(true);
});

it('logical2 false', () => {
const logical1 = new BooleanValueObject(true);
const logical2 = new BooleanValueObject(false);
const logical1 = BooleanValueObject.create(true);
const logical2 = BooleanValueObject.create(false);
const result = textFunction.calculate(logical1, logical2);
expect(result.getValue()).toBe(true);
});

it('logical1 is array, no logical value', () => {
const logical1 = new ArrayValueObject({
const logical1 = ArrayValueObject.create({
calculateValueList: transformToValueObject([
['a1'],
['a2'],
Expand All @@ -80,7 +80,7 @@ describe('Test or function', () => {
});

it('logical1 is array and logical2 is array', () => {
const logical1 = new ArrayValueObject({
const logical1 = ArrayValueObject.create({
calculateValueList: transformToValueObject([
['a1'],
['a2'],
Expand All @@ -92,7 +92,7 @@ describe('Test or function', () => {
row: 0,
column: 0,
});
const logical2 = new ArrayValueObject({
const logical2 = ArrayValueObject.create({
calculateValueList: transformToValueObject([
[true],
['a4'],
Expand All @@ -109,7 +109,7 @@ describe('Test or function', () => {
});

it('logical1 is array and logical2 is array, error value', () => {
const logical1 = new ArrayValueObject({
const logical1 = ArrayValueObject.create({
calculateValueList: transformToValueObject([
['a1'],
['a2'],
Expand All @@ -121,7 +121,7 @@ describe('Test or function', () => {
row: 0,
column: 0,
});
const logical2 = new ArrayValueObject({
const logical2 = ArrayValueObject.create({
calculateValueList: transformToValueObject([
[false],
['#NAME?'],
Expand Down

0 comments on commit 37acb36

Please sign in to comment.